aboutsummaryrefslogtreecommitdiff
path: root/gitstatus
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-05-06 17:35:35 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-05-06 17:35:35 +0300
commitb451b7a75821afedba6e9fa3c422e8eca9f8dedc (patch)
treedd861d0f9f87abc73c35cbbb9ec7e51ffd1dc62b /gitstatus
parenteb8aaecf628fada1c0b005e34f493d530af6b2b6 (diff)
pull upstream changes from gitstatus
Diffstat (limited to 'gitstatus')
-rw-r--r--gitstatus/gitstatus.plugin.zsh9
1 files changed, 7 insertions, 2 deletions
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh
index fa8e9c1f..9dce8c00 100644
--- a/gitstatus/gitstatus.plugin.zsh
+++ b/gitstatus/gitstatus.plugin.zsh
@@ -296,8 +296,11 @@ function gitstatus_start() {
function _gitstatus_cleanup_${ZSH_SUBSHELL}_${daemon_pid}() {
emulate -L zsh
setopt err_return no_unset
- local -i daemon_pid=${${(%):-%N}#_gitstatus_cleanup_${ZSH_SUBSHELL}_}
- [[ $daemon_pid -gt 0 ]] && kill -- -$daemon_pid &>/dev/null || true
+ local fname=${(%):-%N}
+ local prefix=_gitstatus_cleanup_${ZSH_SUBSHELL}_
+ [[ $fname == ${prefix}* ]] || return 0
+ local -i daemon_pid=${fname#$prefix}
+ kill -- -$daemon_pid &>/dev/null || true
}
add-zsh-hook zshexit _gitstatus_cleanup_${ZSH_SUBSHELL}_${daemon_pid}
@@ -399,6 +402,8 @@ function gitstatus_stop() {
add-zsh-hook -d zshexit $cleanup_func
unfunction $cleanup_func
fi
+
+ return 0
}
# Usage: gitstatus_check NAME.