aboutsummaryrefslogtreecommitdiff
path: root/gitstatus
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-03-22 14:40:22 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-03-22 14:40:22 +0300
commit27b415f7f5822b0611e1fa167b6f4c335060d57a (patch)
treea81ad517c77d8fddf8b96b81781794cf088b36b9 /gitstatus
parent3fd0e63776aaf5147b9336d822bf41ebc37f9b7d (diff)
pull upstream changes from gitstatus
Diffstat (limited to 'gitstatus')
-rw-r--r--gitstatus/gitstatus.plugin.zsh8
1 files changed, 4 insertions, 4 deletions
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh
index f3c91eb7..3fede495 100644
--- a/gitstatus/gitstatus.plugin.zsh
+++ b/gitstatus/gitstatus.plugin.zsh
@@ -233,13 +233,13 @@ function gitstatus_start() {
IFS='' read -r -d $'\x1e' -u $resp_fd -t $timeout reply
[[ $reply == $'hello\x1f0' ]]
- function _gitstatus_cleanup_${daemon_pid}() {
+ function _gitstatus_cleanup_${ZSH_SUBSHELL}_${daemon_pid}() {
emulate -L zsh
setopt err_return no_unset
- local -i daemon_pid=${${(%)${:-%N}}#_gitstatus_cleanup_}
- kill -- -$daemon_pid &>/dev/null || true
+ local -i daemon_pid=${${(%)${:-%N}}#_gitstatus_cleanup_${ZSH_SUBSHELL}_}
+ [[ $daemon_pid -gt 0 ]] && kill -- -$daemon_pid &>/dev/null
}
- add-zsh-hook zshexit _gitstatus_cleanup_${daemon_pid}
+ add-zsh-hook zshexit _gitstatus_cleanup_${ZSH_SUBSHELL}_${daemon_pid}
}
start && {