Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Functions/Init/.autocomplete__async
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ ${0}:precmd() {
.autocomplete:async:clear() {
# If we exit the ZLE before the last hook widget called, then it won't be able to close the fd.
[[
-v _autocomplete__async_fd && _autocomplete__async_fd -ge 10 && -t $_autocomplete__async_fd
-v _autocomplete_async_fd && _autocomplete_async_fd -ge 10
]] &&
{ : <&$_autocomplete_async_fd } 2>/dev/null &&
exec {_autocomplete_async_fd}<&- &&
unset _autocomplete_async_fd
unset curcontext _autocomplete__isearch
Expand Down Expand Up @@ -194,7 +195,7 @@ ${0}:precmd() {

# Unhook ourselves immediately, so we don't get called more than once.
builtin zle -F "$fd" 2> /dev/null
[[ -t $fd ]] && exec {fd}<&-
{ : <&$fd } 2>/dev/null && exec {fd}<&-

if [[ -n $_autocomplete__zle_flags ]]; then
builtin zle -f $_autocomplete__zle_flags
Expand Down Expand Up @@ -370,7 +371,7 @@ ${0}:precmd() {
(( SECONDS += reply[2] ))

} always {
[[ -t $fd ]] && exec {fd}<&-
{ : <&$fd } 2>/dev/null && exec {fd}<&-
}

[[ -n $curcontext ]] &&
Expand Down
Loading