diff --git a/src/strategies/completion.zsh b/src/strategies/completion.zsh index f869aa2..246f0bd 100644 --- a/src/strategies/completion.zsh +++ b/src/strategies/completion.zsh @@ -44,8 +44,12 @@ _zsh_autosuggest_capture_setup() { # zpty processes. if ! is-at-least 5.4; then zshexit() { - kill -KILL $$ - sleep 1 # Block for long enough for the signal to come through + # The zsh builtin `kill` fails sometimes in older versions + # https://unix.stackexchange.com/a/477647/156673 + kill -KILL $$ 2>&- || command kill -KILL $$ + + # Block for long enough for the signal to come through + sleep 1 } fi diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index ffc0a1a..753228e 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -526,8 +526,12 @@ _zsh_autosuggest_capture_setup() { # zpty processes. if ! is-at-least 5.4; then zshexit() { - kill -KILL $$ - sleep 1 # Block for long enough for the signal to come through + # The zsh builtin `kill` fails sometimes in older versions + # https://unix.stackexchange.com/a/477647/156673 + kill -KILL $$ 2>&- || command kill -KILL $$ + + # Block for long enough for the signal to come through + sleep 1 } fi