The other way of making a shell a login shell is to run it yourself with the option -l ; typing ` zsh -l ' will start a zsh that also thinks it's a login shell, and later I'll explain how to turn on options within the shell, which you can do with the login option too.
You can change the default shell that new Terminal windows and tabs open with. 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.
To configure iTerm2 with bash you have to open Preferences and change the COMMAND on General tab on your default profile. You have to enter /bin/bash or whatever shell you want.
chsh -s $(which zsh)
You'll be prompted for your password, but once you update your settings any new iTerm/Terminal sessions you start on that machine will default to zsh.
In iTerm -> Preferences -> Profiles Tab -> General section set Command to: /bin/zsh --login
Go to the Users & Groups pane of the System Preferences -> Select the User -> Click the lock to make changes (bottom left corner) -> right click the current user select Advanced options... -> Select the Login Shell: /bin/zsh and OK
The command to change the shell at startup is chsh -s <path_to_shell>
. The default shells in mac OS X are installed inside the bin
directory so if you want to change to the default zsh
then you would use the following
chsh -s /bin/zsh
If you're using different version of zsh
then you might have to add that version to /etc/shells
to avoid the nonstandard shell message. For example if you want home-brew's version of zsh
then you have to add /usr/local/bin/zsh
to the aforementioned file which you can do in one command sudo sh -c "echo '/usr/local/bin/zsh' >> /etc/shells"
and then run
chsh -s /usr/local/bin/zsh
Or if you want to do the whole thing in one command just copy and paste this if you have zsh already installed
sudo sh -c "echo '/usr/local/bin/zsh' >> /etc/shells" && chsh -s /usr/local/bin/zsh
Have you tried editing the shell entry in account settings.
Go to the Accounts preferences, unlock, and right-click on your user account for the Advanced Settings dialog. Your shell should be /bin/zsh, and you can edit that invocation appropriately (i.e. add the --login argument).
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