Zsh
I finally switched from Bash to Zsh too on my desktop machines. You can consult my configuration in my dotfiles.
Various Articles Worth Reading
Using colors in Scripts
Zsh provides a module one load that sets up some variables to use to style your terminal output. Load the module with
autoload -Uz colors && colors
This defines the following arrays:
colorandcolourwith a lot of associations between words and ANSI codes$fg,$fg_boldand$fg_no_boldfor foreground color sequences$bg,$bg_boldand$bg_no_boldfor background color sequences
Some examples:
$color[31]has valueredwhile$color[red]has value31- The
$fg[red]has emits an escape sequence to change foreground color to red - The
$bg[blue]has emits an escape sequence to change background color to blue $reset_colordoes a color reset
The fg* and bg* arrays contain the following colors:
- black
- blue
- cyan
- default
- gray
- green
- grey
- magenta
- red
- white
- yellow
Based on this blog post