diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-10-12 16:03:01 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-10-12 16:03:01 +0300 |
commit | 3775ec7175d7cea49c15aa2f0d48fa9d9efb80e0 (patch) | |
tree | 8f214f9cca284a3c389b88b13f75051e2b5d9156 /gitstatus | |
parent | af2b394eb393feef13073f7ac61bcf5947439aa8 (diff) |
pull upstream changes from gitstatus
Diffstat (limited to 'gitstatus')
-rw-r--r-- | gitstatus/gitstatus.plugin.zsh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh index 6e603ae3..d64421db 100644 --- a/gitstatus/gitstatus.plugin.zsh +++ b/gitstatus/gitstatus.plugin.zsh @@ -383,6 +383,7 @@ function gitstatus_start() { $recurse_untracked_dirs) local cmd=" + exec >&4 echo \$\$ ${(q)daemon} $daemon_args if [[ \$? != (0|10) && \$? -le 128 && -f ${(q)daemon}-static ]]; then @@ -395,7 +396,7 @@ function gitstatus_start() { # 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 >$resp_fifo 2>$log_file 3<$lock_file &! + 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 @@ -405,7 +406,10 @@ function gitstatus_start() { (( async )) && { daemon_pid=-1 } || { - read -u $resp_fd daemon_pid + local reply IFS='' + read -ru $resp_fd reply + [[ $reply == <1-> ]] + daemon_pid=reply function _gitstatus_process_response_${name}() { local name=${${(%):-%N}#_gitstatus_process_response_} @@ -418,7 +422,6 @@ function gitstatus_start() { } zle -F $resp_fd _gitstatus_process_response_${name} - local reply IFS='' read -r -d $'\x1e' -u $resp_fd -t $timeout reply [[ $reply == $'hello\x1f0' ]] |