Mac OS X Shells Mac OS X comes with the Bourne Again SHell (bash) as the default user shell and also includes the TENEX C shell (tcsh), the Korn shell (ksh), and the Z shell (zsh). bash, ksh, and zsh are compatible with sh, the original Bourne shell.
1. sudo nano /etc/shells
2. add /usr/local/bin/fish to your list of shells
3. chsh -s /usr/local/bin/fish
From Terminal:
Add Fish to /etc/shells
, which will require an administrative password:
sudo echo /usr/local/bin/fish >> /etc/shells
Make Fish your default shell with chsh
:
chsh -s /usr/local/bin/fish
From System Preferences:
User and Groups → ctrl-click on Current User → Advanced Options...
Change Login shell to /usr/local/bin/fish
Press OK, log out and in again
You can use chsh to change a user's shell.
Run the following code, for instance, to change your shell to Zsh
chsh -s /bin/zsh
As described in the manpage, and by Lorin, if the shell is not known by the OS, you have to add it to its known list: /etc/shells
.
These are applicable to macOS v10.12.5 (Sierra) (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.
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 OS X 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.
See this screenshot where zsh
is being set as default.
I am using macOS v10.12 (Sierra). It also works in macOS v10.14 (Mojave).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With