display user@host in red if user == root

This commit is contained in:
Sven Schliesing 2015-11-26 09:25:21 +01:00 committed by Sven Schliesing
commit 979c350ab6

View file

@ -1,4 +1,9 @@
PROMPT=$'%{$fg_bold[green]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\
if [ "$USER" = "root" ]
then USER_AT_HOST_COLOR="red"
else USER_AT_HOST_COLOR="green"
fi
PROMPT=$'%{$fg_bold[$USER_AT_HOST_COLOR]%}%n@%m %{$fg[blue]%}%D{[%I:%M:%S]} %{$reset_color%}%{$fg[white]%}[%~]%{$reset_color%} $(git_prompt_info)\
%{$fg[blue]%}->%{$fg_bold[blue]%} %#%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%}["