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...

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

I Found My Productivity MACHINE After a Decade of Keyboards This issue is brought to you by: 🔍 Elevate Your UI Testing with Squish 🔍 Achieving seamless cross-platform testing doesn’t have to be complex. Squish provides a powerful solution for automating UI tests across all major operating systems, with robust support for Java, Windows, mobile applications, and more. Start Your Free Trial Today! “We become what we behold. We shape our tools, and thereafter our tools shape us.” - John Culkin,...

The Cursor Experience, With Neovim's Magic This issue is brought to you by: Auth0 lets you authenticate25,000 users for free! Get Started Here! The line between human and AI-assisted coding is becoming increasingly blurred. While VS Code (oh my god I mentioned it) users have been enjoying AI assistance through GitHub Copilot or better yet, “switching” to it’s popular fork - Cursor AI, which creates an “immersive” coding experience by literally having a conversation with the code base. With...

It was only two weeks ago that I felt like I’m on the bleeding edge of technology after realizing I’ve been ignoring fish shell and decided to give it a go. The pile of comments mentioning Nushell left me no choice, so today we’re checking it out, and trying to see whether it’s worth the switch, and for whom. Ever felt frustrated parsing JSON or CSV files in your terminal? I know I did. The traditional Unix shell treats everything as text streams, making it surprisingly hard to work with...