pull upstream changes from gitstatus

pull/450/head
romkatv 5 years ago
parent 0a7f7c85c4
commit 453907bbbc

@ -421,18 +421,15 @@ function gitstatus_start() {
${(q)daemon}-static $daemon_args ${(q)daemon}-static $daemon_args
fi fi
echo -nE $'bye\x1f0\x1e'" echo -nE $'bye\x1f0\x1e'"
local setsid=${commands[setsid]:-/usr/local/opt/util-linux/bin/setsid}
[[ -x $setsid ]] && setsid=${(q)setsid} || setsid=
# Try to use the same executable as the current zsh. Some people like having an ancient # 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` 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 # zsh -mc '' &! # hangs when using zsh 5.0.2
local zsh=${${:-/proc/self/exe}:A} local zsh=${${:-/proc/self/exe}:A}
[[ -x $zsh ]] || zsh=zsh [[ -x $zsh ]] || zsh=zsh
cmd="cd /; read; unsetopt bg_nice; $setsid ${(q)zsh} -dfxc ${(q)cmd} &!; rm -f ${(q)req_fifo} ${(q)resp_fifo} ${(q)lock_file}" cmd="cd /; read; unsetopt bg_nice; ${(q)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 # 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 # startup). Double fork is to daemonize.
# 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 -w -o cloexec,sync -u req_fd $req_fifo

Loading…
Cancel
Save