diff --git a/src/async.zsh b/src/async.zsh index a300a85..3775d4d 100644 --- a/src/async.zsh +++ b/src/async.zsh @@ -58,6 +58,7 @@ _zsh_autosuggest_async_request() { _zsh_autosuggest_async_response() { emulate -L zsh + typeset -g _ZSH_AUTOSUGGEST_ASYNC_FD _ZSH_AUTOSUGGEST_CHILD_PID local suggestion if [[ $# == 1 || "$2" == "hup" ]]; then @@ -67,6 +68,8 @@ _zsh_autosuggest_async_response() { # Close the fd exec {1}<&- + _ZSH_AUTOSUGGEST_ASYNC_FD= + _ZSH_AUTOSUGGEST_ASYNC_PID= fi # Always remove the handler diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index 5520857..7a583a4 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -813,6 +813,7 @@ _zsh_autosuggest_async_request() { _zsh_autosuggest_async_response() { emulate -L zsh + typeset -g _ZSH_AUTOSUGGEST_ASYNC_FD _ZSH_AUTOSUGGEST_CHILD_PID local suggestion if [[ $# == 1 || "$2" == "hup" ]]; then @@ -822,6 +823,8 @@ _zsh_autosuggest_async_response() { # Close the fd exec {1}<&- + _ZSH_AUTOSUGGEST_ASYNC_FD= + _ZSH_AUTOSUGGEST_ASYNC_PID= fi # Always remove the handler