Go back to tracking last pid because kill %1 didn't seem to be working

This commit is contained in:
Eric Freese 2017-01-25 00:00:53 -07:00
parent 54e1eee924
commit 6c5cd42331
2 changed files with 8 additions and 2 deletions

View file

@ -16,13 +16,16 @@ _zsh_autosuggest_async_suggestion_server() {
stty -onlcr stty -onlcr
local strategy=$1 local strategy=$1
local last_pid
while IFS='' read -r -d $'\0' prefix; do while IFS='' read -r -d $'\0' prefix; do
# Kill last bg process # Kill last bg process
kill -KILL %1 &>/dev/null kill -KILL $last_pid &>/dev/null
# Run suggestion search in the background # Run suggestion search in the background
(echo -n -E "$($strategy "$prefix")"$'\0') & (echo -n -E "$($strategy "$prefix")"$'\0') &
last_pid=$!
done done
} }

View file

@ -511,13 +511,16 @@ _zsh_autosuggest_async_suggestion_server() {
stty -onlcr stty -onlcr
local strategy=$1 local strategy=$1
local last_pid
while IFS='' read -r -d $'\0' prefix; do while IFS='' read -r -d $'\0' prefix; do
# Kill last bg process # Kill last bg process
kill -KILL %1 &>/dev/null kill -KILL $last_pid &>/dev/null
# Run suggestion search in the background # Run suggestion search in the background
(echo -n -E "$($strategy "$prefix")"$'\0') & (echo -n -E "$($strategy "$prefix")"$'\0') &
last_pid=$!
done done
} }