Apple - Suppressing "The default interactive shell is now zsh" message in macOS Catalina
I found the solution on reddit. The solution is also mentioned in the "How to use a different shell without changing the default" section of the Apple support article mentioned in the bash warning: https://support.apple.com/en-us/HT208050/.
Add:
export BASH_SILENCE_DEPRECATION_WARNING=1
to $HOME/.bash_profile
, $HOME/.profile
or $HOME/.bashrc
and restart iTerm. After that, the warning message will be gone.
Apple's /bin/bash
is fairly antiquated (currently v3.2.57). I just switch to use the bash shipped by homebrew (currently v5.0.18), which will incidentally also remove that deprecation warning.
Steps:
- Install homebrew if you haven't already https://docs.brew.sh/Installation
- In a terminal run:
brew update && brew install bash && sudo chsh -s /usr/local/bin/bash $(whoami)
I found that becoming root then adding the deprication suppression in /etc/profile was more reliable. I was already using ZSH and I was getting the warning every time I opened a new console. Terribly annoying. /etc/profile now reads as follows:
# System-wide .profile for sh(1)
export BASH_SILENCE_DEPRECATION_WARNING=1
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi