summaryrefslogtreecommitdiff
path: root/gitstatus/gitstatus.plugin.zsh
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-03-08 05:04:49 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-03-08 05:04:49 +0300
commit206d6ac638d248f29bba8ec505c5dea3c0fefc70 (patch)
tree7935c47bdcc0652ec4cecdd2179e5b5b9aa69b6b /gitstatus/gitstatus.plugin.zsh
parenta562b4243ed68d7e0cade431d859a8df82b2b258 (diff)
work around bugs in zplug. it hangs on startup if you start a subshell in the background
Diffstat (limited to 'gitstatus/gitstatus.plugin.zsh')
-rw-r--r--gitstatus/gitstatus.plugin.zsh12
1 files changed, 6 insertions, 6 deletions
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh
index faf41651..652b25c0 100644
--- a/gitstatus/gitstatus.plugin.zsh
+++ b/gitstatus/gitstatus.plugin.zsh
@@ -215,12 +215,12 @@ function gitstatus_start() {
log=$(mktemp "${TMPDIR:-/tmp}"/gitstatus.$$.log.XXXXXXXXXX)
- (
- nice -n -20 $daemon --dirty-max-index-size=$max_dirty --parent-pid=$$ \
- <&$req_fd >&$resp_fd 2>$log || true
- echo -nE $'bye\x1f0\x1e' >&$resp_fd || true
- rm -f $req_fifo $resp_fifo
- ) &!
+ # We use `zsh -c` instead of plain {} or () to work around bugs in zplug. It hangs on startup.
+ zsh -c "
+ ${(q)daemon}2 --dirty-max-index-size=${(q)max_dirty} --parent-pid=$$
+ echo -nE $'bye\x1f0\x1e'
+ rm -f ${(q)req_fifo} ${(q)resp_fifo}
+ " <&$req_fd >&$resp_fd 2>$log &!
daemon_pid=$!