[zsh] Return value in the prompt – that's a must
This commit is contained in:
parent
084f6a9c42
commit
3e96424c5f
1 changed files with 11 additions and 1 deletions
|
@ -8,7 +8,17 @@ function my_pwd {
|
|||
: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_SUFFIX=""
|
||||
|
|
Loading…
Reference in a new issue