From 979c350ab6c06008c80b88c8c8e22e76cad003dc Mon Sep 17 00:00:00 2001 From: Sven Schliesing Date: Thu, 26 Nov 2015 09:25:21 +0100 Subject: [PATCH] display user@host in red if user == root --- themes/candy.zsh-theme | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/themes/candy.zsh-theme b/themes/candy.zsh-theme index bc125c5ce..efc4dca88 100644 --- a/themes/candy.zsh-theme +++ b/themes/candy.zsh-theme @@ -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]%}["