diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-05-17 12:02:11 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-05-17 12:02:11 +0000 |
commit | 15b5a882b73befe6b2d0ad06d48cb17d72c6dd82 (patch) | |
tree | f7dec383bb11855b5091f3ed5cf89a961dafc3c7 /modules/shell | |
parent | 0da8fc117c601e8f979c5be2c404ef487963cecc (diff) | |
download | nixlib-15b5a882b73befe6b2d0ad06d48cb17d72c6dd82.tar nixlib-15b5a882b73befe6b2d0ad06d48cb17d72c6dd82.tar.gz nixlib-15b5a882b73befe6b2d0ad06d48cb17d72c6dd82.tar.bz2 nixlib-15b5a882b73befe6b2d0ad06d48cb17d72c6dd82.tar.lz nixlib-15b5a882b73befe6b2d0ad06d48cb17d72c6dd82.tar.xz nixlib-15b5a882b73befe6b2d0ad06d48cb17d72c6dd82.tar.zst nixlib-15b5a882b73befe6b2d0ad06d48cb17d72c6dd82.zip |
modules/zsh: don't repeat exit before every prompt
Diffstat (limited to 'modules/shell')
-rw-r--r-- | modules/shell/zsh/zshrc.nix | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/shell/zsh/zshrc.nix b/modules/shell/zsh/zshrc.nix index 123d49258b4b..c25704c0eb28 100644 --- a/modules/shell/zsh/zshrc.nix +++ b/modules/shell/zsh/zshrc.nix @@ -189,6 +189,18 @@ done # Prompt nl=$'\n' -PS1="%F{yellow}%(?..[exit %?]$nl)%1(j.[%j job%2(j.s.)] .)%f%# " +PS1="%F{yellow}%1(j.[%j job%2(j.s.)] .)%f%# " + +preexec() { + show_exit=1 +} + +precmd() { + ex="$?" + if [[ -n "$show_exit" && "$ex" -ne 0 ]] + then echo -e "\e[33m[exit $ex]\e[0m" + fi + unset show_exit +} '' |