fish is great software. It’s my favorite shell. I love the marketing.

fish stands for Friendly Interactive SHell. It’s a word that is easy to say (what’s that, zsh users?) and a name that covers exactly why you would want to use it.

The tagline for fish is ‘Finally, a command line shell for the 90s’. That is a joke I find funny, but is also the most ironic way in which a piece of software was ever sold to me.

Sane defaults

People ask me why I use fish. The answer is that it has sane defaults. Not only are the defaults sane, they’re nice, they’re friendly. The way the arrow keys work, the colors, the default prompt, those are great defaults for anyone who has become familiar with computer in or after the 1990s. I learned to use computers in the 2000s and struggled learning bash. fish immediately made sense to me. When I have a problem with fish, I get helpful error messages. The fish language is designed so that you’re less likely to write code that is difficult to understand or dangerous.

Some people want to write very terse shell scripts. I am not one of those people, I believe that terseness is often a false economy. If something is complicated, then it’s probably worth spending some extra time to type it out. If the time you need to type your complicated shell command or script is holding you back, you may be better served with code reuse (functions, programs) than with a terse language. The terseness of bash and its legacy compatiblity give it a staggering learning curve, which is a time investment that may not pay itself back.

I want to drive a Citroën DS

bash is not great software: it’s difficult to use and the user interface seems to be entirely designed around legacy considerations. I was not alive in the 70s, I don’t want to run software from the 70s and I don’t believe software was better in the 70s. Why should I be burdened with learning to deal with the way software was in those days?

To explain my automobile-obsessed self, I’ll go on a tangent. One day, I want to drive a Citroën DS. It is perhaps the most beautiful car ever made, and undoubtedly far ahead of its time. However, when I learned to drive a car, I did not learn to drive in a car from 1955. Even though I have the ambition to drive a car that came out in 1955, I did not learn to drive in an old car. I learned to drive in a new car because that’s the normal thing to do, and I knew I would be driving modern cars far more often than older cars. If the opportunity to drive a classic car would ever arise, I can learn how to do so then.

Likewise, I cannot be bothered to learn bash properly. If a situation arises in which I must use bash, it is likely not in a life-threatening emergency in which I cannot use the internet to learn how. I don’t think having bash as a default shell is a sane default, except for the fact that so many people are now used to it.

The sane defaults that will never become the default

bash or a compatible shell will always be the default in most Unix-like systems. It’s a self-fullfilling prophecy: systems ship with a default shell with insane defaults and a dangerous and illogical language that is unlike programming languages modern power users are used to. But then this bash knowledge becomes powerful, because you can write commands and scripts that work on nearly any Unix-like system.

Switching to fish is also realizing that there will be moments in which you still need to know bash. But I’d rather learn bash not quite well than have a shell that is compatible with it, because a great shell is by definition not compatible with bash.

If you are already using zsh, totally tricked out with your favorite dotfiles and most of the stuff that makes fish nice to use, I won’t convince you to switch to fish. And I don’t think you should. However, if you want to have a comfortable shell, you can start using fish and change nearly nothing. Maybe install a few plugins, change a few settings, read the manual on how it differs from bash. I have recommended fish to command line beginners without much success, because bash’s ubiquity makes it seem like a sensible time investment. If you’re starting out as a Unix-like command line user, all the StackOverflow answers will be for the default shell. Making more complex commands work in fish is yet another thing to take care of. We collectively decided that we’d rather have worse software because we’ve invested so much time into dealing with how bad it is than think of how command line usage could be more enjoyable.

fish users are great users

So what happens is the opposite of what you would expect. fish users are not beginners, even though it is a shell that is much more suited to beginners than the alternatives. All fish users I know are people who have at least a working understanding of bash and Unix-like command lines in general. Not because you have to, but because we’ve created a world in which switching shells is for advanced users, even if the shell doesn’t require you to be an advanced user.

I like talking to other fish users, for a variety of reasons. They might have similar ideas to me about user interfaces. They are people who have invested some time and thought into their workflow, so there’s more likely to be an exchange of knowledge. There’s a lively plugin and customization ecosystem for fish. All of the project pages for these plugins look nice and are written clearly. Installing plugins is easy, and if you run into trouble, you’ll find that someone else had a similar issue before you in a Github issue. That issue will likely have people that explain their points in a friendly and succinct way. Long story short, it’s a great community.

Conclusion

And that’s basically all I want to say about shells, and fish in particular. The ubiquity of bash is unique, in that there’s really quite few reasons why you would choose it over alternative. Should the default be fish? Probably not, as POSIX compatibility is a reasonable and pervasive requirement of a default shell. Should it be bash? Absolutely not.

Give fish a try if you can. It may forever be an ‘alternative’, but not by any fault of its own.

Notes

  • The official website uses the words ‘fish shell’ to disambiguate fish from the aquatic animals. I’m not opposed to doing that, but the pedantic side of me keeps thinking ‘ATM machine’, given the ‘sh’ in ‘fish’ is for ‘shell’.