Saturday, August 29, 2020

Mac Terminal Update

MacOS changed the default TERMINAL shell from bash to zsh with the Catalina release (10.15.x). (echo $SHELL tells you what shell terminal is using). This means customizing your terminal prompt from .bash_profile no longer works. The solution is to create a .zshrc file in your home (username) directory and insert the following line: (dot files are hidden by default on mac, view in finder by hitting command-shift-dot while in the folder with hidden files)

PROMPT='%F{green}%1~ $ %f'

This customizes the prompt to include the current directory name (%1~), to use the $ character as the prompt with a space on either side, and to be green (%F{colorselection}%f)

The customization automatically works with VISUAL STUDIO CODE (which I now am using in place of Sublime Text as a text editor / code editor, because it includes a Terminal window).

No comments:

Post a Comment