aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-03-15 21:14:10 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-03-15 21:14:10 +0300
commitbad4e62e93598e326936b90f33acde635b35c016 (patch)
treedb6eed7704ee4c247b05e94457405ac46785eaba /powerlevel9k.zsh-theme
parent5c816e13cae5cf45212a5b582e32cbb5ae146003 (diff)
kill timer process on exit
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme6
1 files changed, 6 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 707f974f..00758edc 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -2093,6 +2093,12 @@ _p9k_init_timer() {
fi
done
" <&$_P9K_TIMER_FD2 >&$_P9K_TIMER_FD1 2>/dev/null &!
+ local pid=$!
+ function _p9k_kill_timer_${pid}() {
+ emulate -L zsh
+ kill -- -${${(%)${:-%N}}#_p9k_kill_timer_} &>/dev/null
+ }
+ add-zsh-hook zshexit _p9k_kill_timer_${pid}
}
if ! _p9k_start_timer ; then