2019年10月20日星期日

Setting non-standard shell as login shell

Bash that is shipped with macOS is pretty old, at least as of Mojave. If you've installed a modern version through Homebrew, you probably need to configure it as your login shell, to save you some troubles with Terminal, iTerm or tmux. This is the way:

sudo chsh -s $(which bash) $(whoami)

Rationale (especially the part how /etc/shells is not touched for sanity reasons):
https://superuser.com/a/48229

Update 2023: I guess history does repeat itself! I ran into this issue again the other day and totally had forgotten I had had this experience before and even the existence of this very blog post. I managed to figure it out from the man page though, which reads:

When altering a login shell, and not the super-user, the user may not change from a non-standard shell or to a non-standard shell. Non-standard is defined as a shell not found in /etc/shells.

没有评论:

发表评论