The default shell on Linux (and macOS?) is bash.
But fish is much nicer. It looks better, it has great autocomplete features and it just works out of the box with no fuss.
You can install beautiful (and useful) themes and prompts which make working with git a breeze.
For example, this is the bobthefish theme:
You can easily see the git branch you’re working on and other information (i.e. if the previous command failed).
You also get pretty unicode symbols - if your terminal supports it.
In Arch Linux, there are two ways to use fish shell:
- as the default shell (replaces bash completely)
- as interactive shell only (less disruptive)
When I installed fish with the package manager and started it, it got launched via urxvt, the terminal emulator on my system.
But urxvt has notorious problems with unicode glyphs. I spend hours trying to get powerline fonts working. And I was not the only one with the problem.
Some fonts provide incorrect values for character width, which breaks their appearance in urxvt in various ways.
So, in the end, the easiest solution is to swich terminal emulators. I know that it’s not a satisfactory answer. But I was keen on using fish with unicode glyphs.
So, how did I get fish on Linux?
- Install st, lxterminal or a different terminal emulator of your choice.
- Install powerline fonts or nerdfonts.
- Add the line
exec fishto your
- Change the default terminal emulator (so that you don’t use urxvt anymore).
- Start the terminal and enjoy your fish shell.
I use i3 window manager and changed my keybindings for the default terminal in
bindsym $mod+Return exec terminal
bindsym $mod+Return exec lxterminal
lxterminal offers an easy way to change fonts.
If you run
fish_config in your command line, you can customize your fish appearance as well.