pull upstream changes from gitstatus
This commit is contained in:
parent
eb8aaecf62
commit
b451b7a758
|
@ -296,8 +296,11 @@ function gitstatus_start() {
|
||||||
function _gitstatus_cleanup_${ZSH_SUBSHELL}_${daemon_pid}() {
|
function _gitstatus_cleanup_${ZSH_SUBSHELL}_${daemon_pid}() {
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
setopt err_return no_unset
|
setopt err_return no_unset
|
||||||
local -i daemon_pid=${${(%):-%N}#_gitstatus_cleanup_${ZSH_SUBSHELL}_}
|
local fname=${(%):-%N}
|
||||||
[[ $daemon_pid -gt 0 ]] && kill -- -$daemon_pid &>/dev/null || true
|
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}
|
add-zsh-hook zshexit _gitstatus_cleanup_${ZSH_SUBSHELL}_${daemon_pid}
|
||||||
|
|
||||||
|
@ -399,6 +402,8 @@ function gitstatus_stop() {
|
||||||
add-zsh-hook -d zshexit $cleanup_func
|
add-zsh-hook -d zshexit $cleanup_func
|
||||||
unfunction $cleanup_func
|
unfunction $cleanup_func
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Usage: gitstatus_check NAME.
|
# Usage: gitstatus_check NAME.
|
||||||
|
|
Loading…
Reference in New Issue