Note that if installed via brew, the path for fish is
/opt/homebrew/bin/fish
Whereas if installed via the official method, the path is
/usr/local/bin/fish
You can check the path of fish on your computer from another shell using this command (for example, here I am in zsh):
❯ which fish
/opt/homebrew/bin/fish
Reference
This article was converted by 简悦 SimpRead, original source at gist.github.com
Install fish shell on macOS Mojave with brew. GitHub Gist: instantly share code, notes, and snippets…
Fish is a smart and user-friendly command line shell (like bash or zsh). This is how you can install Fish on macOS and make it your default shell.
Note that you need the https://brew.sh/ package manager installed on your machine.
brew install fish
More info: https://fishshell.com/docs/current/tutorial.html#tut_path
Check the fish path with which fish. In the examples below, it was located at: /opt/homebrew/bin/fish. On older Macs the default path is /usr/local/bin/fish, replace accordingly in the instruction below.
Make fish the default shell
macOS allows you to change your default shell using command line or GUI methods https://support.apple.com/en-us/102360.
Using the terminal:
- check the fish path with
which fish. In the examples below it was located at: /opt/homebrew/bin/fish. On older Macs the path might differ.
chsh -s /opt/homebrew/bin/fish
Add brew binaries in fish path
run the command: fish_add_path /opt/homebrew/bin
To collect command completions for all commands run:
fish_update_completions
I edited the ~/.config/fish/config.fish to have my terminal in English
set -x LANG en_US.UTF-8
You can configure your shell by launching the web interface, run:
fish_config