diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2019-11-29 13:31:58 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2019-11-29 13:31:58 +0300 |
commit | a9af1e86b1c1c28fad7ae4107c7481d7b86506de (patch) | |
tree | c8a9aea892d2990ae431303acccfb321ed763c7b | |
parent | d55923be8749889d18fee54f6b6a4853343f049e (diff) |
survive ancient zsh in PATH
-rw-r--r-- | internal/p10k.zsh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index d499c9e9..9be1f1d0 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4455,8 +4455,10 @@ _p9k_init_async_pump() { local setsid=${commands[setsid]:-/usr/local/opt/util-linux/bin/setsid} [[ -f $setsid ]] && setsid=${(q)setsid} || setsid= - cmd="$setsid zsh -dfc ${(q)cmd} &!" - zsh --nobgnice -dfmc $cmd </dev/null >&$_p9k__async_pump_fd 2>/dev/null &! + local zsh=${${:-/proc/self/exe}:A} + [[ -x $zsh ]] || zsh=zsh + cmd="$setsid ${(q)zsh} -dfc ${(q)cmd} &!" + $zsh --nobgnice -dfmc $cmd </dev/null >&$_p9k__async_pump_fd 2>/dev/null &! IFS='' read -t 5 -r -u $_p9k__async_pump_fd _p9k__async_pump_pid && (( _p9k__async_pump_pid )) |