From f9ef70cac91d3a9991efe987fa551a22dfbba426 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Mon, 16 Sep 2013 23:51:33 +0200 Subject: [PATCH] zsh/rc: Use red # as prompt for root. --- zsh/rc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zsh/rc b/zsh/rc index 6b646b5..4cd6967 100644 --- a/zsh/rc +++ b/zsh/rc @@ -418,6 +418,8 @@ zshrc_prompt_precmd() { local background="%(1j.${yellow}%j${default}.)" # Exit code in bright red in parentheses if not zero. local exitcode="%(?..(${red}%B%?%b${default}%) )" + # Prompt symbol, % for normal users, # in red for root. + local symbol="%(!.${red}#${default}.%%)" # Prefix characters in first and second line. local top_prefix="${blue}%B.-%b${default}" @@ -452,7 +454,7 @@ zshrc_prompt_precmd() { local top_separator="%B${blue}${(l:${width}::-:)}%b${default}" PROMPT="${top_prefix}${top_left}${top_separator}${top_right} -${bottom_prefix}${user}@${host} ${background}%# ${exitcode}" +${bottom_prefix}${user}@${host} ${background}${symbol} ${exitcode}" } precmd_functions+=(zshrc_prompt_precmd) -- 2.45.2