1
0
Fork 0

Add last exit code to zsh prompt

This commit is contained in:
Jeremy Kaplan 2018-02-19 12:38:00 -08:00
commit 4f0fe1d32f

View file

@ -5,6 +5,7 @@ SAVEHIST=1000000
DIRSTACKSIZE=100
setopt appendhistory extendedglob nomatch
setopt autopushd pushdsilent pushdtohome histignorespace
setopt printexitvalue
unsetopt beep autocd notify
bindkey -e
# End of lines configured by zsh-newuser-install
@ -59,10 +60,11 @@ else
fi
local dir="${green}%~%f"
local branch="\$(parse_git_branch)"
local exit_code="%(?.${green}.${red})%?%f"
setopt prompt_subst
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
source $HOME/.config/zsh/aliases