From: Frank Terbeck Date: Mon, 23 Jun 2014 22:59:02 +0000 (+0200) Subject: zshrc: Use modern colour codes with modern zsh versions X-Git-Tag: v0.9.6~2 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=fd56fcdf4c8d2fc07c5789aed732a19f1d5e5f67 zshrc: Use modern colour codes with modern zsh versions Signed-off-by: Frank Terbeck --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index d6c3dd3..ce02c95 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -1597,7 +1597,16 @@ fi # is433 # set colors for use in prompts (modern zshs allow for the use of %F{red}foo%f # in prompts to get a red "foo" embedded, but it's good to keep these for # backwards compatibility). -if zrcautoload colors && colors 2>/dev/null ; then +if is437; then + BLUE="%F{blue}" + RED="%F{red}" + GREEN="%F{green}" + CYAN="%F{cyan}" + MAGENTA="%F{magenta}" + YELLOW="%F{yellow}" + WHITE="%F{white}" + NO_COLOR="%f" +elif zrcautoload colors && colors 2>/dev/null ; then BLUE="%{${fg[blue]}%}" RED="%{${fg_bold[red]}%}" GREEN="%{${fg[green]}%}"