aboutsummaryrefslogtreecommitdiff
path: root/gitstatus/gitstatus.plugin.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-11-29 12:40:13 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-11-29 12:56:03 +0300
commite67ad0fe382625f73f7070e176f265fb01f2c5f6 (patch)
tree15e8fae3578f4b0b978d0c650fd4e22294b459a8 /gitstatus/gitstatus.plugin.zsh
parent213ef3e42603fd42375dfbaa6d30357dbe84696a (diff)
pull upstream changes from gitstatus
Diffstat (limited to 'gitstatus/gitstatus.plugin.zsh')
-rw-r--r--gitstatus/gitstatus.plugin.zsh10
1 files changed, 8 insertions, 2 deletions
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh
index 5c6a9e39..24e0b624 100644
--- a/gitstatus/gitstatus.plugin.zsh
+++ b/gitstatus/gitstatus.plugin.zsh
@@ -412,11 +412,17 @@ function gitstatus_start() {
echo -nE $'bye\x1f0\x1e'"
local setsid=${commands[setsid]:-/usr/local/opt/util-linux/bin/setsid}
[[ -x $setsid ]] && setsid=${(q)setsid} || setsid=
- cmd="cd /; read; $setsid zsh -dfxc ${(q)cmd} &!; rm -f ${(q)req_fifo} ${(q)resp_fifo} ${(q)lock_file}"
+ # Try to use the same executable as the current zsh. Some people like having an ancient
+ # `zsh` in their PATH while using a newer version. zsh 5.0.2 hangs when enabling `monitor`.
+ #
+ # zsh -mc '' &! # hangs when using zsh 5.0.2
+ local zsh=${${:-/proc/self/exe}:A}
+ [[ -x $zsh ]] || zsh=zsh
+ cmd="cd /; read; $setsid $zsh -dfxc ${(q)cmd} &!; rm -f ${(q)req_fifo} ${(q)resp_fifo} ${(q)lock_file}"
# We use `zsh -c` instead of plain {} or () to work around bugs in zplug (it hangs on
# startup). Double fork is to daemonize, and so is `setsid`. Note that on macOS `setsid` has
# to be installed manually by running `brew install util-linux`.
- zsh -dfmxc $cmd <$req_fifo >$log_file 2>&1 3<$lock_file 4>$resp_fifo &!
+ $zsh -dfmxc $cmd <$req_fifo >$log_file 2>&1 3<$lock_file 4>$resp_fifo &!
sysopen -w -o cloexec,sync -u req_fd $req_fifo
sysopen -r -o cloexec -u resp_fd $resp_fifo