mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
Merge pull request #628 from jeebak/develop
Ensure that we're using the builtin exec
This commit is contained in:
commit
2c9e57fd50
2 changed files with 6 additions and 6 deletions
|
@ -11,7 +11,7 @@ _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 and remove the handler
|
# Close the file descriptor and remove the handler
|
||||||
exec {_ZSH_AUTOSUGGEST_ASYNC_FD}<&-
|
builtin exec {_ZSH_AUTOSUGGEST_ASYNC_FD}<&-
|
||||||
zle -F $_ZSH_AUTOSUGGEST_ASYNC_FD
|
zle -F $_ZSH_AUTOSUGGEST_ASYNC_FD
|
||||||
|
|
||||||
# We won't know the pid unless the user has zsh/system module installed
|
# We won't know the pid unless the user has zsh/system module installed
|
||||||
|
@ -32,7 +32,7 @@ _zsh_autosuggest_async_request() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fork a process to fetch a suggestion and open a pipe to read from it
|
# Fork a process to fetch a suggestion and open a pipe to read from it
|
||||||
exec {_ZSH_AUTOSUGGEST_ASYNC_FD}< <(
|
builtin exec {_ZSH_AUTOSUGGEST_ASYNC_FD}< <(
|
||||||
# Tell parent process our pid
|
# Tell parent process our pid
|
||||||
echo $sysparams[pid]
|
echo $sysparams[pid]
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ _zsh_autosuggest_async_response() {
|
||||||
zle autosuggest-suggest -- "$suggestion"
|
zle autosuggest-suggest -- "$suggestion"
|
||||||
|
|
||||||
# Close the fd
|
# Close the fd
|
||||||
exec {1}<&-
|
builtin exec {1}<&-
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Always remove the handler
|
# Always remove the handler
|
||||||
|
|
|
@ -768,7 +768,7 @@ _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 and remove the handler
|
# Close the file descriptor and remove the handler
|
||||||
exec {_ZSH_AUTOSUGGEST_ASYNC_FD}<&-
|
builtin exec {_ZSH_AUTOSUGGEST_ASYNC_FD}<&-
|
||||||
zle -F $_ZSH_AUTOSUGGEST_ASYNC_FD
|
zle -F $_ZSH_AUTOSUGGEST_ASYNC_FD
|
||||||
|
|
||||||
# We won't know the pid unless the user has zsh/system module installed
|
# We won't know the pid unless the user has zsh/system module installed
|
||||||
|
@ -789,7 +789,7 @@ _zsh_autosuggest_async_request() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fork a process to fetch a suggestion and open a pipe to read from it
|
# Fork a process to fetch a suggestion and open a pipe to read from it
|
||||||
exec {_ZSH_AUTOSUGGEST_ASYNC_FD}< <(
|
builtin exec {_ZSH_AUTOSUGGEST_ASYNC_FD}< <(
|
||||||
# Tell parent process our pid
|
# Tell parent process our pid
|
||||||
echo $sysparams[pid]
|
echo $sysparams[pid]
|
||||||
|
|
||||||
|
@ -825,7 +825,7 @@ _zsh_autosuggest_async_response() {
|
||||||
zle autosuggest-suggest -- "$suggestion"
|
zle autosuggest-suggest -- "$suggestion"
|
||||||
|
|
||||||
# Close the fd
|
# Close the fd
|
||||||
exec {1}<&-
|
builtin exec {1}<&-
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Always remove the handler
|
# Always remove the handler
|
||||||
|
|
Loading…
Reference in a new issue