brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: chsh -s /bin/zsh switches your Mac account to zsh and ends the bash notice

Mac
~/tips/tip-macos-chsh-zsh-default-shell

chsh -s /bin/zsh

Changes your account's login shell to zsh, or quiets the notice if you stay on bash.

Every Mac account made since macOS 10.15 starts in zsh. If your account is older, you may still be in bash and see the notice that the default interactive shell is now zsh every time you open Terminal.

Apple’s fix is one command:

chsh -s /bin/zsh

chsh accepts the shells listed in /etc/shells, so cat /etc/shells shows your choices. Open a new window and echo $SHELL should print /bin/zsh. You can make the same change in System Settings under Users & Groups: Control-click your name, choose Advanced Options and pick a Login shell.

Want to stay in bash? That is allowed. Apple documents a way to silence the notice: add this line to ~/.bash_profile or ~/.profile:

export BASH_SILENCE_DEPRECATION_WARNING=1

A shell from Homebrew, like a newer bash in /opt/homebrew/bin, is not in /etc/shells out of the box, so you add its path there with admin rights before chsh accepts it.

The caveat is your old settings. zsh does not read .bash_profile or .bashrc. Apple’s mapping is that .zprofile takes the place of .bash_profile and .zshrc the place of .bashrc. Simple export lines move over unchanged, but a bash prompt with PS1 escapes needs rewriting, because zsh uses different prompt codes. If you keep things in a POSIX ~/.profile, Apple suggests this line in .zprofile:

[[ -e ~/.profile ]] && emulate sh -c 'source ~/.profile'

Further reading: Apple Support: Use zsh as the default shell on Mac, chsh man page (macOS)

Going deeper: Guide: keep your Mac apps in a Brewfile, so a new MacBook is one command away

More Mac tips 4. Hold Shift and click Continue in Safe Mode 1. Shut down the Mac System Settings > Lock Screen > Show message when locked (on) Modifier key for scroll gesture: Control Allow in the Background (switches) All Mac tips (9) All topics

Link