[zsh] Return value in the prompt – that's a must

This commit is contained in:
M1dgard 2018-08-20 23:57:21 +02:00
parent 084f6a9c42
commit 3e96424c5f
Signed by untrusted user who does not match committer: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -8,7 +8,17 @@ function my_pwd {
:end') :end')
} }
PROMPT='%{$fg[yellow]%}$(my_pwd)$(git_prompt_info)$(git_prompt_status) %{$reset_color%} ' function my_retval {
RETVAL=$?
if [[ $RETVAL -eq 0 ]]; then
echo "$fg[yellow]"
else
echo "$fg[red]$RETVAL "
fi
}
PROMPT='%{$(my_retval)%}$(my_pwd)$(git_prompt_info)$(git_prompt_status) %{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}  " ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}  "
ZSH_THEME_GIT_PROMPT_SUFFIX="" ZSH_THEME_GIT_PROMPT_SUFFIX=""