Text coloring in zsh

(last updated on )

You can color your text in zsh by using the %F{...} syntax. To view all available colors use:

for i in {1..256}; do print -P "%F{$i}Color : $i"; done;
Listing all possible colors in zsh

To reset the colors use the special value %F{reset}.

Usage example

I am displaying the current time in on the right hand side of my terminal, in dark gray. The clock will conveniently stop for executed tasks, so that I automatically can see when I started that particular task.


You can do that by using the following config in your .zshrc:

# Show timestamp whan a command
# was issued in the right prompt


    zle reset-prompt

Other Shells

Users of bash can use this guide: When did I run that command?