I do not like to retype fish every time I start terminal. I want fish
on by default. How can I set fish shell as my default shell on a Mac?
These are applicable to MacOS Sierra 10.12.5 (16F73) and probably some other recent and upcoming versions of MacOS.
chsh
is not enough to change the default shell. Make sure you press Command+, while your terminal is open and change the 'Shells open with' option to 'Default login shell.'
In case of bash, make sure that you execute echo $BASH_VERSION
to confirm you are running the intended version of bash. bash --version
does not give you correct information.
Mac OS X: How to change the Terminal shell
To change your default shell on mac run the following:
chsh -s <name-of-shell>
List of shells you can choose from are:
so if you want to change from to the /bin/zsh shell, your command will look like:
chsh -s /bin/zsh
you can see all the available shells on your system by running:
cat /etc/shells
Here's another way to do it:
Assuming you installed it with MacPorts, which can be done by doing:
sudo port install fish
Your shell will be located in /opt/local/bin/fish
.
You need to tell OSX that this is a valid shell. To do that, add this path to the end of the /etc/shells
file.
Once you've done this, you can change the shell by going to System Preferences -> Accounts. Click on the Lock to allow changes. Right-click on the account, and choose "Advanced Options...". In the "Login shell" field, add the path to fish.
heimdall:~ leeg$ dscl
Entering interactive mode... (type "help" for commands)
> cd /Local/Default/Users/
/Local/Default/Users > read <<YOUR_USER>>
[...]
UserShell: /bin/bash
/Local/Default/Users >
just change that value (with the write command in dscl
).
the chsh
program will let you change your default shell. It will want the full path to the executable, so if your shell is fish
then it will want you to provide the output given when you type which fish
.
You'll see a line starting with "Shell:
". If you've never edited it, it most likely says "Shell: /bin/bash
". Replace that /bin/bash
path with the path to your desired shell.