mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-12-28 15:14:51 +08:00
We also need to remove the handler when cancelling async request
Should fix GitHub #353
This commit is contained in:
parent
0ee5b0a5c9
commit
93877f6b76
|
@ -10,8 +10,9 @@ _zsh_autosuggest_async_request() {
|
||||||
|
|
||||||
# If we've got a pending request, cancel it
|
# If we've got a pending request, cancel it
|
||||||
if [[ -n "$_ZSH_AUTOSUGGEST_ASYNC_FD" ]] && { true <&$_ZSH_AUTOSUGGEST_ASYNC_FD } 2>/dev/null; then
|
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}<&-
|
exec {_ZSH_AUTOSUGGEST_ASYNC_FD}<&-
|
||||||
|
zle -F $_ZSH_AUTOSUGGEST_ASYNC_FD
|
||||||
|
|
||||||
# Assume the child process created a new process group and send
|
# Assume the child process created a new process group and send
|
||||||
# TERM to the group to attempt to kill all descendent processes
|
# TERM to the group to attempt to kill all descendent processes
|
||||||
|
|
|
@ -689,8 +689,9 @@ _zsh_autosuggest_async_request() {
|
||||||
|
|
||||||
# If we've got a pending request, cancel it
|
# If we've got a pending request, cancel it
|
||||||
if [[ -n "$_ZSH_AUTOSUGGEST_ASYNC_FD" ]] && { true <&$_ZSH_AUTOSUGGEST_ASYNC_FD } 2>/dev/null; then
|
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}<&-
|
exec {_ZSH_AUTOSUGGEST_ASYNC_FD}<&-
|
||||||
|
zle -F $_ZSH_AUTOSUGGEST_ASYNC_FD
|
||||||
|
|
||||||
# Assume the child process created a new process group and send
|
# Assume the child process created a new process group and send
|
||||||
# TERM to the group to attempt to kill all descendent processes
|
# TERM to the group to attempt to kill all descendent processes
|
||||||
|
|
Loading…
Reference in New Issue
Block a user