How can I set my default shell on a Mac, e.g. to Fish? [closed]
I do not like to retype fish
every time I start terminal. I want Fish on by default. How can I set the Fish shell as my default shell on a Mac?
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.