Search code examples
colorszsh

Can't get colors to work in Zsh; text works, but no colors appearing


I just got a Mac and I'm trying to customize my Zsh prompt with colors but I can't get colors to work. I'm not sure if its because of LS_COLORS or what.

Here's my .zshrc

export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad

# TERMINAL PROMPT
PROMPT="%F{purple}%f%F{orange}%f%n %d >> "

export PROMPT;

Solution

  • %F and %f act more like 'start color' and 'stop color', so they need to surround the text and operators that you want to colorize. Also, very few named colors are supported (just black, red, green, yellow, blue, magenta, cyan and white); you'll have better luck with the numeric values from the xterm column of this table.

    Try this:

    PROMPT="%F{magenta}%n%f %F{214}%d%f >> "