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?
CodePudding user response:
- 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.”