Explorar el Código

We also need to remove the handler when cancelling async request

Should fix GitHub #353
pull/359/head
Eric Freese hace 6 años
padre
commit
93877f6b76
Se han modificado 2 ficheros con 4 adiciones y 2 borrados
  1. +2
    -1
      src/async.zsh
  2. +2
    -1
      zsh-autosuggestions.zsh

+ 2
- 1
src/async.zsh Ver fichero

@ -10,8 +10,9 @@ _zsh_autosuggest_async_request() {
# If we've got a pending request, cancel it
if [[ -n "$_ZSH_AUTOSUGGEST_ASYNC_FD" ]] && { true <&$_ZSH_AUTOSUGGEST_ASYNC_FD } 2>/dev/null; then
# Close the file descriptor
# Close the file descriptor and remove the handler
exec {_ZSH_AUTOSUGGEST_ASYNC_FD}<&-
zle -F $_ZSH_AUTOSUGGEST_ASYNC_FD
# Assume the child process created a new process group and send
# TERM to the group to attempt to kill all descendent processes

+ 2
- 1
zsh-autosuggestions.zsh Ver fichero

@ -689,8 +689,9 @@ _zsh_autosuggest_async_request() {
# If we've got a pending request, cancel it
if [[ -n "$_ZSH_AUTOSUGGEST_ASYNC_FD" ]] && { true <&$_ZSH_AUTOSUGGEST_ASYNC_FD } 2>/dev/null; then
# Close the file descriptor
# Close the file descriptor and remove the handler
exec {_ZSH_AUTOSUGGEST_ASYNC_FD}<&-
zle -F $_ZSH_AUTOSUGGEST_ASYNC_FD
# Assume the child process created a new process group and send
# TERM to the group to attempt to kill all descendent processes

Cargando…
Cancelar
Guardar