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):
- Add the path for fish (
/usr/local/bin/fish
as installed by Homebrew) to the list of system shells in/etc/shells
- 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:
- Create the functions directory for fish if it does not already exists, the path is
~/.config/fish/functions
- Add a prompt function file in the functions directory:
~/.config/fish/functions/fish_prompt.fish
- 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: