Why do I keep getting a terminal error about the zsh shell?

What can happen to my computer if it does not like the zsh shell

MacBook Pro 13″, macOS 12.6

Posted on Jul 26, 2023 10:49 AM

Reply
Question marked as Top-ranking reply

Posted on Jul 26, 2023 11:55 AM

I can guess what's going on.


There are several command line interpreters ("shells") that you can run on Unix and Linux systems. Among them are sh ("shell"), csh ("C shell"), bash ("Bourne Again shell"), and zsh.


Apple once chose bash to be the default shell. After a while they stopped including the latest versions of bash in macOS. Then they made zsh the new default shell. I read somewhere that newer versions of bash fell under a GPLv3 license and that Apple never shipped macOS with a version of bash that fell under that license. (Read into that what you will.)


I'm guessing that you once used a version of macOS in which bash was the default shell. When macOS set up your user account, it chose bash to be your shell, and that setting has remained.


The message that you are seeing is Apple trying to "encourage" you to switch to zsh (their new shell of choice). The command


chsh -s /bin/zsh


means "change the default shell for my account to zsh." (/bin/zsh is where zsh lives.)


You can ignore the nagging and keep using Apple's old version of bash. Or you can type the command to start using zsh. If you do enter the suggested command, then next time you run Terminal, I think you'll find that the message has gone away.


6 replies
Question marked as Top-ranking reply

Jul 26, 2023 11:55 AM in response to Mastersorbust

I can guess what's going on.


There are several command line interpreters ("shells") that you can run on Unix and Linux systems. Among them are sh ("shell"), csh ("C shell"), bash ("Bourne Again shell"), and zsh.


Apple once chose bash to be the default shell. After a while they stopped including the latest versions of bash in macOS. Then they made zsh the new default shell. I read somewhere that newer versions of bash fell under a GPLv3 license and that Apple never shipped macOS with a version of bash that fell under that license. (Read into that what you will.)


I'm guessing that you once used a version of macOS in which bash was the default shell. When macOS set up your user account, it chose bash to be your shell, and that setting has remained.


The message that you are seeing is Apple trying to "encourage" you to switch to zsh (their new shell of choice). The command


chsh -s /bin/zsh


means "change the default shell for my account to zsh." (/bin/zsh is where zsh lives.)


You can ignore the nagging and keep using Apple's old version of bash. Or you can type the command to start using zsh. If you do enter the suggested command, then next time you run Terminal, I think you'll find that the message has gone away.


Jul 26, 2023 1:23 PM in response to Mastersorbust

You have options:


  • Don't launch the Terminal application
  • Continue to use the existing Bash shell and ignore the /usr/bin/chsh -s /bin zsh informational message on Terminal launch
  • Perform that /usr/bin/chsh -s /bin/zsh


If you continue to use the ancient Bash shell, no harm will befall you for that decision. You can open the .bash_profile text file in your home directory and add this entry to suppress the chsh line:


BASH_SILENCE_DEPRECATION_WARNING=1


and that chsh -s /bin/zsh notice will disappear on any new Terminal session.


If you do decide to be adventurous and elect to configure the Zsh shell, you will need to run that change shell command:


sudo /usr/bin/chsh -s /bin/zsh
Password:⚿


Note: your administrator password will not echo in the Terminal.


Since the Zsh shell does not read your Bash dot files, you will need to create a minimal Zsh .dot file that has your PATH and PS1 prompt information as a bare minimum. Copy and paste the following into your Terminal after you have performed the above chsh command. After you paste, press return to run the HERE script:


<<"EOF" > ~/.zshrc
export PATH=".:/usr/local/bin:${PATH}"
PS1="%m: %~ %% "
EOF


and to invoke your PATH and PS1 Terminal prompt for the current Terminal window:


source ~/.zshrc



Jul 26, 2023 10:57 AM in response to Mastersorbust

The default interactive shell is now zsh.


To update your account to use zsh, please run `chsh -s /bin/zsh`.


For more details, please visit Use zsh as the default shell on your Mac - Apple Support


Sadly, I go to the support page and it is a bit confusing for me. And again, if i start messing with that, how will it affect the performance on my computer? Thanks!


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Why do I keep getting a terminal error about the zsh shell?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.