zsh: visual tweaks to prompt

This commit is contained in:
Fernando Schauenburg 2024-07-27 22:43:06 +02:00
parent 62dd4efc38
commit 3949848924

View file

@ -29,20 +29,19 @@ render_prompt() {
"$(render_exec_time)"
)
local separator="${zfg[gray]} "
echo ${(pj.$separator.)sections:#}
echo -n "${zfg[gray]}"
printf '%.0s' {1..$SHLVL}
echo -n "${zfg[rst]} "
local separator=" ${zfg[faded]} "
echo "${(@pj.$separator.)sections:#}${zfg[gray]}"
(($SHLVL > 1)) && printf '󰅂%.0s' {2..$SHLVL}
echo -n " ${zfg[rst]}"
}
render_exit_code() {
((PROMPT_EXIT_CODE == 0)) && return
if ((PROMPT_EXIT_CODE > 128 && PROMPT_EXIT_CODE < 160)); then
print "${fg_white}$(kill -l $PROMPT_EXIT_CODE)"
print "%{%B%}${zfg[white]}$(kill -l $PROMPT_EXIT_CODE)%{%b%}"
else
print "${fg_red}$PROMPT_EXIT_CODE"
print "%{%B%}${zfg[red]}$PROMPT_EXIT_CODE%{%b%}"
fi
}