Monday, November 18, 2019

Fix to lost zsh prompt settings in MacOS Catalina

A major portion of our Radiator team are MacOS/Linux users and even on Windows usually run Linux/GNU/UNIX command line tools. In the recent MacOS Catalina Apple switched from bash shell to the zsh shell and there was much rejoicing.

However, to the annoyance of at least the writer, Apple changed their zsh configuration so that setting up terminal prompt in user's own .zshenv did not work anymore.

This is caused by Apple's default configuration in /etc/zshrc, which is read/run for interactive shells after user's .zshenv. In the Apple's default configuration the prompt is set up as follows:

# Default prompt
PS1="%n@%m %1~ %# "

To override this, just put PS1/PROMPT settings (and other settings you may want to override for interactive shells) into user's .zshrc and the problem is solved.