Colored Terminal with zsh

for the last versions of macOS

Posted by Daniel Vela on May 26, 2022
Read this page in a different language:

Last macOS versions have zsh by default, instead bash. Better than try to use bash again, is to use a new way to add color to Terminal for zsh.

Create a file called .zshrc in your $HOME path, with the following content (then restart terminal):

export LS_COLORS
export CLICOLOR=1
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
PROMPT='%F{green}%n@%m%k %B%F{cyan}%(4~|...|)%3~%F{white} %# %b%f%k'

Additional Doc