From 7b4d295b094966a09c8453c9ed0f687339074236 Mon Sep 17 00:00:00 2001
From: Ayaz Badouraly <ayaz.badouraly@via.ecp.fr>
Date: Fri, 28 Oct 2016 17:05:33 +0200
Subject: [PATCH] Setting color output according to $?

---
 via.zsh-theme | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/via.zsh-theme b/via.zsh-theme
index ab57119..123f16e 100644
--- a/via.zsh-theme
+++ b/via.zsh-theme
@@ -8,11 +8,11 @@ if [[ $UID -ne 0 ]];
 then
 	# normal user
 	local user="%{$fg_bold[red]%}%n%{$reset_color%}"
-	local eol="%{$fg_bold[yellow]%}%%%{$reset_color%}"
+	local eol="%{%(?.$fg_bold[yellow].$fg_bold[red])%}%%%{$reset_color%}"
 else
 	# root
 	local user="%{$fg_bold[blue]%}%n%{$reset_color%}"
-	local eol="%{$fg_bold[yellow]%}#%{$reset_color%}"
+	local eol="%{%(?.$fg_bold[yellow].$fg_bold[red])%}#%{$reset_color%}"
 fi
 
 local user_host="${user}%{$fg_bold[yellow]%}@%{$fg_bold[white]%}%m%{$reset_color%}"
-- 
GitLab