diff --git a/zshrc b/zshrc index 020540c..a3161ca 100644 --- a/zshrc +++ b/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