aboutsummaryrefslogtreecommitdiff
path: root/gitstatus/gitstatus.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'gitstatus/gitstatus.plugin.zsh')
-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.