From: Simon Ruderich Date: Mon, 16 Sep 2013 21:51:33 +0000 (+0200) Subject: zsh/rc: Use red # as prompt for root. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=f9ef70cac91d3a9991efe987fa551a22dfbba426;p=config%2Fdotfiles.git zsh/rc: Use red # as prompt for root. --- 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)