Add last exit code to zsh prompt
This commit is contained in:
parent
c0898c7e8c
commit
4f0fe1d32f
1 changed files with 3 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ SAVEHIST=1000000
|
||||||
DIRSTACKSIZE=100
|
DIRSTACKSIZE=100
|
||||||
setopt appendhistory extendedglob nomatch
|
setopt appendhistory extendedglob nomatch
|
||||||
setopt autopushd pushdsilent pushdtohome histignorespace
|
setopt autopushd pushdsilent pushdtohome histignorespace
|
||||||
|
setopt printexitvalue
|
||||||
unsetopt beep autocd notify
|
unsetopt beep autocd notify
|
||||||
bindkey -e
|
bindkey -e
|
||||||
# End of lines configured by zsh-newuser-install
|
# End of lines configured by zsh-newuser-install
|
||||||
|
|
@ -59,10 +60,11 @@ else
|
||||||
fi
|
fi
|
||||||
local dir="${green}%~%f"
|
local dir="${green}%~%f"
|
||||||
local branch="\$(parse_git_branch)"
|
local branch="\$(parse_git_branch)"
|
||||||
|
local exit_code="%(?.${green}.${red})%?%f"
|
||||||
|
|
||||||
setopt prompt_subst
|
setopt prompt_subst
|
||||||
export PROMPT="${prompt}"
|
export PROMPT="${prompt}"
|
||||||
export RPROMPT="${lbrkt}${user}${colon}${host}${colon}${dir}${branch}${rbrkt}"
|
export RPROMPT="${exit_code} ${lbrkt}${user}${colon}${host}${colon}${dir}${branch}${rbrkt}"
|
||||||
|
|
||||||
# aliases
|
# aliases
|
||||||
source $HOME/.config/zsh/aliases
|
source $HOME/.config/zsh/aliases
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue