Home >System Tutorial >MAC >The Default Interactive Shell Is Now Zsh: How to Remove It on Mac?
macOS default shell switched to Zsh: Complete Guide
When starting your Mac, it may be surprising to see a prompt to switch the default interactive shell from Bash to Zsh. However, this is just one way Apple adapts and develops, aiming to provide users with a better shell experience.
The advantage of macOS is that users do not have to be limited to any particular shell. Whether you are a big fan of Bash or are interested in Zsh, the choice is always in your hands.
This guide will provide you with a clear explanation. We will explain step by step the reason behind this change and, more importantly, we will guide you on how to do so that you can choose the shell with confidence.
The meaning of "default interactive shell is now Zsh"
Warning message "Default interactive shell is now Zsh" indicates that macOS's Terminal has switched from Bash to Zsh. If you don't use Terminal often, don't worry. But for the average user, while this is a noteworthy shift, it hardly changes how you typically interact in Terminal.
Why does this warning message appear?
This warning message is to remind you of the underlying changes in macOS. The main reasons for this warning are as follows:
Is Zsh good for your Mac?
Zsh (also known as Z shell) was built on Bash, which was once the preferred shell for macOS. Given its rich functionality, using Zsh instead of Bash is usually the best choice. To further enhance the experience, we recommend that you introduce a framework for Zsh that customizes how you handle settings, plugins, and appealing themes.
What to do after seeing the message "Default interactive shell is now Zsh"
For some Mac users, encountering this message can be confusing. But, don't worry. Next, we will guide you the steps you can take after seeing this message:
How to switch from Zsh to Bash
Luckily, switching between Zsh and Bash is very simple. To switch from Zsh to Bash, type chsh -s /bin/bash
in your Terminal. After restarting, the new session will use Bash by default.
The following are the steps to change Zsh to Bash:
/bin/bash
. How to switch to Bash using Homebrew
To switch to a new shell (such as Bin/Bash), add its name to the shell file and save it. This step ensures that your computer knows that you can use the shell. You can think of it as a safety net to prevent you from accidentally selecting content that may cause problems.
The following are detailed instructions for switching Zsh to Bash using Homebrew:
xcode-select --install
and press Enter. When prompted, click Install and wait patiently for the process to complete. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
and press Enter. This may take some time, please wait. /opt/homebrew/bin
is not in your PATH, please copy its recommended commands and paste them into Terminal as recommended by Homebrew. Use Enter to confirm. brew update && brew install bash && sudo chsh -s /usr/local/bin/bash $(whoami)
to update and build your new Bash shell. Using Homebrew (the popular package manager for macOS), you can easily install newer versions of bash and set it as your default shell.
How to hide the "default interactive shell is now Zsh" and continue using Bash
For those who appreciate Zsh's advanced features but are still loyal to Bash, there is a way to mute the default shell notifications. After integrating a specific code snippet (export BASH_SILENCE_DEPRECATION_WARNING=1
) into a configuration file (e.g. ~/.bash_profile
, ~/.profile
, or ~/.bashrc
), you can easily use Bash instead of Zsh on your Mac.
The following are the steps to cancel the warning and continue using Bash in logical order:
touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile
. ~/.bash_profile
with ~/.profile
or ~/.bashrc
in the command and run it again. Summary
Switching between Zsh and Bash can feel a little overwhelmed at first. So our team explores how to mute annoying notifications and makes some tweaks to adopt the shell of your choice.
However, there are more broad aspects here. In addition to updates and settings, it is important to keep your Mac continuously maintained. This is where MacKeeper's memory cleaner comes into play. By managing your Mac's memory and saying goodbye to time-consuming processes, you can not only fix the issues, but also prevent new issues.
If you find this guide helpful, don't forget to check out our other expert guide on Zsh denied permission on Mac and checking the health of SSD on Mac for more insights and solutions.
The above is the detailed content of The Default Interactive Shell Is Now Zsh: How to Remove It on Mac?. For more information, please follow other related articles on the PHP Chinese website!