I've Been Definitely Using The Wrong Terminal Shell


When it comes to terminal shells, many developers (myself included) have stuck with what they know or what they've seen others use online, without exploring other options.
It's time to venture out and discover the world of terminal shells.

Most developers are likely using Zsh, a POSIX-compatible shell, probably with Oh My Zsh on top. But there's a whole spectrum of shells out there, each with its own strengths and quirks. Today, we're going to explore three major players: Bash, Zsh, and Fish.

The Shell Showdown

  1. Bash (Bourne Again Shell): The old reliable. It's POSIX-compatible and comes with a scripting language that can be used in executable files or inline in the shell. Bash introduced features like VI mode, which allows you to use Vim-like commands in your terminal.
    We all need to know bash in some way; it's everywhere, comes with any server, any linux flavour and a trusted shell to be familiar with when others aren't available.
  2. Zsh (Z Shell): The popular middle ground. It's POSIX-compatible like Bash but comes with more modern features. Zsh has a thriving community building tools like, Oh My Zsh and "zsh for humans" that add syntax highlighting, autocompletions, and more. There's a great reason Apple made ZSH the default shell recently, and why most developers are running it locally.
  3. Fish (Friendly Interactive Shell): The new kid on the block. Fish comes with many features out of the box that Bash and Zsh require configuration to achieve. It offers syntax highlighting, autocompletion, and even a web-based configuration interface. The feel around fish is a user-first, experience-in-mind approach to everything, and you owe yourself a try!
"Fish is a Unix-like shell with a focus on interactivity and usability. Fish is designed to be feature-rich by default, rather than highly configurable.

Most people either stick with Bash or switch to Zsh with Oh My Zsh (or get it by default with their machine). While this works, it often requires extensive configuration and doesn't provide the most user-friendly experience out of the box. Why work if you can get so much by installing one simple shell?

Configuring Bash or Zsh to be truly user-friendly can be time-consuming and overwhelming for many developers. Even with tools like Oh My Zsh, there's still a learning curve and potential for bloat.

Consider giving Fish a try.

As Oliver Kiddle, Jerry Peek, and Peter Stephenson note in their book "From Bash to Z Shell: Conquering the Command Line", each shell has its strengths, but Fish stands out for its user-friendliness and out-of-the-box features.

Fish comes with syntax highlighting, intuitive autocompletion, and web-based(!) configuration by default. It's not POSIX-compatible, which means some scripts might not work directly, but it offers a much gentler learning curve for newcomers and a refreshing change for experienced developers.

Putting It Into Action

  1. Install Fish on your system (brew install fish / nix-env -iA nixpkgs.fish - pick your poison 👺)
  2. Try out its features like autocompletion and syntax highlighting without any configuration.
  3. Explore the fish_config command to customize your shell through a web interface.
  4. Experiment with Fish's scripting language for your shell scripts. This isn't a must though; as long as you keep a bash shabang on your old POSIX scripts, you're good.

Remember, you don't have to switch completely.
You can use Fish for interactive use while keeping Bash or Zsh for scripts that require POSIX compatibility!

By exploring different shells, you'll not only potentially find a more comfortable working environment but also broaden your understanding of command-line interfaces.

Thanks for reading!
Feel free to reply directly with thoughts and questions.

See ya next week...

Whenever you’re ready, here’s how I can help you:

ESPRESSO FRIDAYS

Every once in a while I send hand picked things I've learned. Kind of like your filter to the tech internet. No spam, I promise!

Read more from ESPRESSO FRIDAYS

6 Neovim Plugins I Use To Troll Code Reviewers The Espresso Fridays is brought to you by: Zero To Running a Kubernetes Application Without Weeks of Studying A hands-on Kubernetes guide to deploy your first scaleable application In under 90 minutes you'll: ✅ Learn all the critical Kubernetes basics from a 10-year industry expert ✅ CUT learning time by 60% with a hands-on application deployment walkthrough ✅ Never feel inexperienced again with the hottest technology in the market Start learning...

Hi friends, Ever felt like your remote pair programming sessions were missing that seamless, in-person collaboration feel? You’re not alone. Many developers struggle to recreate the magic of side-by-side coding in a virtual environment. A recent study shows that pair programming has been proven to catch mistakes early, reduce defects, and lead to better designs. The same study found that teams who practice pair programming not only produce shorter, more efficient code but also solve problems...

Hi friends, Are you tired of juggling multiple apps for note-taking and writing? Many of us struggle to find a seamless system that combines powerful text editing with effective note organization. While popular note-taking apps offer fancy features, they often fall short for those who prefer a keyboard-centric, or should I say Vim-centric workflow. Most people resort to using dedicated note-taking applications like Obsidian, Notion, or even Apple notes. These tools are great for casual users,...