diff options
| author | Loïc Yhuel <loic.yhuel@gmail.com> | 2024-04-04 16:20:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-04 16:20:20 +0200 |
| commit | 9d529c41cc82580d0a947ce8bcf5ff7775585fe5 (patch) | |
| tree | 9d1293fd8ff50c3bb3b572c176819de59da92514 /lib/async_prompt.zsh | |
| parent | 114b58ed4e93faee352187779c7151f8580f24fe (diff) | |
| download | zsh-9d529c41cc82580d0a947ce8bcf5ff7775585fe5.tar.gz zsh-9d529c41cc82580d0a947ce8bcf5ff7775585fe5.tar.bz2 zsh-9d529c41cc82580d0a947ce8bcf5ff7775585fe5.zip | |
perf(async): avoid executing `true` if not required (#12318)
The issue which required "command true" was fixed in zsh 5.8.
Diffstat (limited to 'lib/async_prompt.zsh')
| -rw-r--r-- | lib/async_prompt.zsh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/async_prompt.zsh b/lib/async_prompt.zsh index ac95bcd73..a83c57f35 100644 --- a/lib/async_prompt.zsh +++ b/lib/async_prompt.zsh @@ -3,6 +3,7 @@ # https://github.com/woefe/git-prompt.zsh/blob/master/git-prompt.zsh zmodload zsh/system +autoload -Uz is-at-least # For now, async prompt function handlers are set up like so: # 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 # 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 read -u $fd "_OMZ_ASYNC_PIDS[$handler]" |
