简体   繁体   中英

How can I change default shell without opening terminal?

New to macOS, and I was trying to change default shell from zsh to fish, but I set wrong default shell path.

Here's what I did:

brew install fish
echo /opt/homebrew/bin/fish | sudo tee -a /etc/shells
chsh -s /usr/bin/fish

I should have typed chsh -s /opt/homebrew/bin/fish , but I typed chsh -s /usr/bin/fish .

Now iterm2 stops with warning message: A session ended very soon after starting. Check that the command in profile "Default" is correct. , so I can't run the chsh -s command.

How can I fix this?

Can I change default shell path without opening terminal?

  • In the Terminal app on your Mac, choose Terminal > Preferences, then click General.
  • Under “Shells open with”, select “Command (complete path)”, then enter the path to the shell you want to use.

You can also change this from System Preferences. Head to System Preferences > Users & Groups on your Mac. Click the lock icon and enter your password. Hold the Ctrl key, click your user account's name in the left pane, and select “Advanced Options.”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM