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
spaceship
and the prompt symbol toλ
from the default%
by add the below in the.zshrc
file
ZSH_THEME="spaceship"
SPACESHIP_CHAR_SYMBOL='λ '
# Set Spaceship ZSH as a prompt
autoload -U promptinit; promptinit
prompt spaceship
- Source the configuration
source ~/.zshrc
or relaunch the terminal. The prompt will be updated.