diff --git a/config/zsh/prompt.zsh b/config/zsh/prompt.zsh index 605d6e3..7b947f8 100644 --- a/config/zsh/prompt.zsh +++ b/config/zsh/prompt.zsh @@ -30,6 +30,7 @@ typeset -gA icons=( render_prompt() { setopt localoptions shortloops + local separator="${zfg[faded]} ❯ " local sections=( "$(render_exit_code)" "$(render_user_host)" @@ -39,9 +40,17 @@ render_prompt() { "$(render_jobs)" "$(render_exec_time)" ) + echo "${(@pj.$separator.)sections:#}${zfg[rst]}" - local separator="${zfg[faded]} ❯ " - echo "${(@pj.$separator.)sections:#}${zfg[gray]}" + local prompt_color + if ((PROMPT_EXIT_CODE == 0)); then + prompt_color="${zfg[faded]}" + elif ((PROMPT_EXIT_CODE > 128 && PROMPT_EXIT_CODE < 160)); then + prompt_color="${zfg[white]}" + else + prompt_color="${zfg[red]}" + fi + echo -n "$prompt_color" (($SHLVL > 1)) && printf '󰅂%.0s' {2..$SHLVL} echo -n "❯ ${zfg[rst]}" }