Fish Shell

Inspired by a recent interview on the Setup, I took a look at a shell called fish. This note is not to sell you on the wonders of fish, but to share some tips for getting started in the fish future.

Default Shell

Instead of running the fish command every time you open a new Terminal window or tab, set fish as the default shell (in OS X):

  1. Add the path for fish (/usr/local/bin/fish as installed by Homebrew) to the list of system shells in /etc/shells
  2. Use the change shell command chsh to set fish as the default for your user account: chsh -s /usr/local/bin/fish

Custom Prompt

To customize the fish prompt you can either use the interactive web-based fish_config command to select from one of the presets or build a custom prompt:

  1. Create the functions directory for fish if it does not already exists, the path is ~/.config/fish/functions
  2. Add a prompt function file in the functions directory: ~/.config/fish/functions/fish_prompt.fish
  3. In it define the fish_prompt function and add a custom prompt, sample prompts are found in the source

As an example, behold my transcendent prompt: