The latest version of macOS uses zsh as the shell. To change the prompt in the Terminal we can do the following.
- Install oh-my-zsh which provides many enhancements to the zsh.
- Install spaceship theme.
npm install -g spaceship-prompt
- Set the theme to
spaceshipand the prompt symbol toλfrom the default%by add the below in the.zshrcfile
ZSH_THEME="spaceship"
SPACESHIP_CHAR_SYMBOL='λ '
# Set Spaceship ZSH as a prompt
autoload -U promptinit; promptinit
prompt spaceship
- Source the configuration
source ~/.zshrcor relaunch the terminal. The prompt will be updated.