X-Git-Url: https://git.alrj.org/?a=blobdiff_plain;f=S22_exitcode;fp=S22_exitcode;h=9888b3480d1754c3f2633ddfe75315e858303d2a;hb=7233001b1aed9a30e46c8e4162d4a8b8abfc3d9a;hp=0000000000000000000000000000000000000000;hpb=2ec3cae4d8fe90c334e802279c995b1771d22818;p=zsh.d.git diff --git a/S22_exitcode b/S22_exitcode new file mode 100644 index 0000000..9888b34 --- /dev/null +++ b/S22_exitcode @@ -0,0 +1,14 @@ +#! /usr/bin/zsh + + +parse_exitcode() { + EX=`print -P %?` + psvar[1]=$EX + + if [[ $EX -ge 128 ]] + then + psvar[1]="${signals[${EX}-127]}" + fi +} + +precmd_functions+='parse_exitcode'