From 6c5cd4233189fb67872a58d21c1368fd1d6d1c9b Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Wed, 25 Jan 2017 00:00:53 -0700 Subject: [PATCH] Go back to tracking last pid because `kill %1` didn't seem to be working --- src/async.zsh | 5 ++++- zsh-autosuggestions.zsh | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/async.zsh b/src/async.zsh index ddc07a5..f0dbc2c 100644 --- a/src/async.zsh +++ b/src/async.zsh @@ -16,13 +16,16 @@ _zsh_autosuggest_async_suggestion_server() { stty -onlcr local strategy=$1 + local last_pid while IFS='' read -r -d $'\0' prefix; do # Kill last bg process - kill -KILL %1 &>/dev/null + kill -KILL $last_pid &>/dev/null # Run suggestion search in the background (echo -n -E "$($strategy "$prefix")"$'\0') & + + last_pid=$! done } diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index 266cdff..a6cbe05 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -511,13 +511,16 @@ _zsh_autosuggest_async_suggestion_server() { stty -onlcr local strategy=$1 + local last_pid while IFS='' read -r -d $'\0' prefix; do # Kill last bg process - kill -KILL %1 &>/dev/null + kill -KILL $last_pid &>/dev/null # Run suggestion search in the background (echo -n -E "$($strategy "$prefix")"$'\0') & + + last_pid=$! done }