How to set my default shell on Mac?

前端 未结 16 875
抹茶落季
抹茶落季 2020-11-30 16:23

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?

相关标签:
16条回答
  • 2020-11-30 17:26

    1. sudo nano /etc/shells enter image description here

    2. add /usr/local/bin/fish to your list of shells enter image description here

    3. chsh -s /usr/local/bin/fish

    0 讨论(0)
  • 2020-11-30 17:26

    This work for me on fresh install of mac osx (sierra):

    1. Define current user as owner of shells
    sudo chown $(whoami) /etc/shells
    
    1. Add Fish to /etc/shells
    sudo echo /usr/local/bin/fish >> /etc/shells
    
    1. Make Fish your default shell with chsh
    chsh -s /usr/local/bin/fish
    
    1. Redefine root as owner of shells
    sudo chown root /etc/shells
    
    0 讨论(0)
  • 2020-11-30 17:27

    Terminal.app > Preferences > General > Shells open with: > /bin/fish

    1. Open your terminal and press command+, (comma). This will open a preferences window.
    2. The first tab is 'General'.
    3. Find 'Shells open with' setting and choose 2nd option which needs complete path to the shell.
    4. Paste the link to your fish command, which generally is /usr/local/bin/fish.

    See this screenshot where zsh is being set as default.

    I am using macOS Sierra. Also works in macOS Mojave.

    0 讨论(0)
  • 2020-11-30 17:27

    In case you are having troubles with the other ways, worked on mac Mojave but should generally work.

    which fish
    

    add the output path to "System Preferences > Users & Groups > right click user, Advanced Options" Paste the result from which into "Login shell:"

    0 讨论(0)
提交回复
热议问题