Fish Shell

Fish advertises itself as a smart and user-friendly command line shell for OS X, Linux, and the rest of the family. If you’re using bash, I highly recommend reading this post and trying fish.


  • Colors out of the box


  • Valid command (blue) vs invalid command (red)


  • Autosuggestions based on history


  • Man page completions

    Example with [command] -[tab]:


    Example with [command][tab]:


  • More


Visit their website at and look under Go Fish. Since I already had Homebrew, I simply ran the following command:

brew install fish


  • Open
  • Preferences (Command + ,)
  • Startup Tab
  • Find the text label Shells open with:
  • Click on Command
  • Paste /usr/local/bin/fish


Alternatively you can change it via the command line:

chsh -s /usr/local/bin/fish

Make sure the file path matches the location of the fish executable on your machine.


Fish provides a web interface that enables some extra configuration. Simply type fish_config inside your shell and hit enter.

A browser should open (localhost:8000) with a website that allows you to perform certain configuration tweaks discussed below.

Change default colors


Change the prompt

The prompt function is defined here: ~/.config/fish/functions/ There are various pre-defined prompt functions you can pick from, or you can create your own.


My prompt function is inside this gist. It may look a bit strange that commands are written in a second line. However, since my terminal usually takes up more space vertically than horizontally I prefer it. There’s also a blank line between each command to help improve readability. If you’re inside a git repository folder it should also display the name of the branch you’re on.

Add functions

Functions in fish wrap common shell tasks. For example, I created a new file: ~/.config/fish/functions/ with the following:

function gs --description 'alias for git status'
    git status -s  $argv

Now every time I type gs into the terminal it will run git status -s.


The example above is just a simple alias, but hopefully it illustrates how easy and useful it can be to create functions.

View variables

It’s possible to set environment variables using the following syntax: set -x greeting hello. You can view some variables using the web interface.


View history



If you found this post useful or have questions, send a tweet or leave a comment. Feel free to show off your prompt, functions or anything fish related in the comments.




  1. Pingback: Favorite Mac Apps by cnandreu

Leave a Reply

Your email address will not be published. Required fields are marked *