zsh: Show fancy return codes
This commit is contained in:
parent
37dac9b013
commit
aaf62b829f
1 changed files with 11 additions and 1 deletions
12
zshrc
12
zshrc
|
@ -23,7 +23,17 @@ setopt prompt_subst
|
|||
if [ "$SSH_CONNECTION" ]; then
|
||||
PROMPT_HOST="%F{yellow}[ssh] $HOST%f "
|
||||
fi
|
||||
export PROMPT='$PROMPT_HOST%(?..%F{red}%? )%f%20<…<%~%<<$(pretty-git-prompt) %F{117}>%f '
|
||||
|
||||
function ret {
|
||||
case $? in
|
||||
0) ;;
|
||||
126) echo "%F{red}[PERMISSION]%f " ;;
|
||||
127) echo "%F{red}[NOTFOUND]%f " ;;
|
||||
<129-254>) echo "%F{red}[SIG$(kill -l $(($? - 127)))]%f " ;;
|
||||
*) echo "%F{red}$?%f " ;;
|
||||
esac
|
||||
}
|
||||
export PROMPT='$PROMPT_HOST$(ret)%f%20<…<%~%<<$(pretty-git-prompt) %F{117}>%f '
|
||||
|
||||
HISTSIZE=20000
|
||||
HISTFILE=~/.zsh_history
|
||||
|
|
Loading…
Reference in a new issue