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}"
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)