mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-11 00:10:08 +00:00
perf(async): avoid executing true
if not required (#12318)
The issue which required "command true" was fixed in zsh 5.8.
This commit is contained in:
parent
114b58ed4e
commit
9d529c41cc
1 changed files with 3 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
# https://github.com/woefe/git-prompt.zsh/blob/master/git-prompt.zsh
|
# https://github.com/woefe/git-prompt.zsh/blob/master/git-prompt.zsh
|
||||||
|
|
||||||
zmodload zsh/system
|
zmodload zsh/system
|
||||||
|
autoload -Uz is-at-least
|
||||||
|
|
||||||
# For now, async prompt function handlers are set up like so:
|
# For now, async prompt function handlers are set up like so:
|
||||||
# First, define the async function handler and register the handler
|
# First, define the async function handler and register the handler
|
||||||
|
@ -93,7 +94,8 @@ function _omz_async_request {
|
||||||
|
|
||||||
# There's a weird bug here where ^C stops working unless we force a fork
|
# There's a weird bug here where ^C stops working unless we force a fork
|
||||||
# See https://github.com/zsh-users/zsh-autosuggestions/issues/364
|
# See https://github.com/zsh-users/zsh-autosuggestions/issues/364
|
||||||
command true
|
# and https://github.com/zsh-users/zsh-autosuggestions/pull/612
|
||||||
|
is-at-least 5.8 || command true
|
||||||
|
|
||||||
# Save the PID from the handler child process
|
# Save the PID from the handler child process
|
||||||
read -u $fd "_OMZ_ASYNC_PIDS[$handler]"
|
read -u $fd "_OMZ_ASYNC_PIDS[$handler]"
|
||||||
|
|
Loading…
Reference in a new issue