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

LimaVM Is Probably The Best MacOS Virtual Machine I've Ever Used If you're tired of Docker Desktop bogging down your machine, or simply don't like fuff of mapping ports, mounting volumes when all you need is a small virtual environment, this one's for you. I recently discovered LimaVM, and it's a game-changer for local development. It lets you spin up Linux VMs with ease, offering a faster, lighter alternative to Docker and other VM managers for many tasks, but especially for development....

Coding Is Changing. Here's How I Stay AHEAD This issue is brought to you by: Ideas to apps in seconds with Lovable Lovable is your superhuman full stack engineer. Click here for double credits when signing up The AI revolution isn't replacing engineers (IMHO) - it's changing how they work and which skills matter most. I mean, look at the sponsor of this week, a "vibe coding" platform that creates your idea in no time. But, does it actually matter for developers / devops and other tech...

Edit Faster: Vim Motions From Scratch Ever watched a developer frantically switching between keyboard and mouse? "Click, type, click, type..." It's like watching someone crawl when they could just walk. If you're tired of granny mode coding and want to boost your productivity, Vim motions might be exactly what you need. Every once in a while, I review my processes, trying to improve systems, tools, and yes, motions. This time I thought, why not share the basics with everyone too? These...