aboutsummaryrefslogtreecommitdiff
path: root/gitstatus/gitstatus.plugin.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-08-06 10:57:33 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-08-06 10:57:33 +0300
commitb4a2de947806b6b8232203e8246e2165791fc672 (patch)
treef30c2079f39018f098554c9cc1d77bd37c5a4c7d /gitstatus/gitstatus.plugin.zsh
parent36d2c588f12d1dd94949a9caadaf3d72cffb7444 (diff)
pull upstream changes from gitstatus
Diffstat (limited to 'gitstatus/gitstatus.plugin.zsh')
-rw-r--r--gitstatus/gitstatus.plugin.zsh10
1 files changed, 5 insertions, 5 deletions
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh
index a68614e4..ce227f60 100644
--- a/gitstatus/gitstatus.plugin.zsh
+++ b/gitstatus/gitstatus.plugin.zsh
@@ -385,16 +385,16 @@ function gitstatus_start() {
read -r -d $'\x1e' -u $resp_fd -t $timeout reply
[[ $reply == $'hello\x1f0' ]]
- function _gitstatus_cleanup_${ZSH_SUBSHELL}_${daemon_pid}() {
+ function _gitstatus_cleanup_$$_${ZSH_SUBSHELL}_${daemon_pid}() {
emulate -L zsh
setopt err_return no_unset
local fname=${(%):-%N}
- local prefix=_gitstatus_cleanup_${ZSH_SUBSHELL}_
+ 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}
[[ $stderr_fd == -1 ]] || {
unsetopt xtrace
@@ -413,7 +413,7 @@ function gitstatus_start() {
unset -f gitstatus_start_impl
} || {
unsetopt err_return
- add-zsh-hook -d zshexit _gitstatus_cleanup_${ZSH_SUBSHELL}_${daemon_pid}
+ add-zsh-hook -d zshexit _gitstatus_cleanup_$$_${ZSH_SUBSHELL}_${daemon_pid}
[[ $daemon_pid -gt 0 ]] && kill -- -$daemon_pid &>/dev/null
[[ $stderr_fd -ge 0 ]] && { exec 2>&$stderr_fd {stderr_fd}>&- }
[[ $lock_fd -ge 0 ]] && zsystem flock -u $lock_fd
@@ -482,7 +482,7 @@ function gitstatus_stop() {
local lock_fd=${(P)lock_fd_var:-}
local daemon_pid=${(P)daemon_pid_var:-}
- local cleanup_func=_gitstatus_cleanup_${ZSH_SUBSHELL}_${daemon_pid}
+ local cleanup_func=_gitstatus_cleanup_$$_${ZSH_SUBSHELL}_${daemon_pid}
[[ -n $daemon_pid ]] && kill -- -$daemon_pid &>/dev/null
[[ -n $req_fd ]] && exec {req_fd}>&-