Skip to content

Commit

Permalink
Revert compdef change
Browse files Browse the repository at this point in the history
This change breaks global completion.
  • Loading branch information
kislyuk committed Dec 3, 2023
1 parent 50ee2c6 commit 7771174
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions argcomplete/bash_completion.d/_python-argcomplete
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ _python_argcomplete_global() {
req_argv=( "" "${COMP_WORDS[@]:1}" )
__python_argcomplete_expand_tilde_by_ref executable
else
if [[ "$service" != "-default-" ]]; then
# TODO: this may not be sufficient - see https://zsh.sourceforge.io/Doc/Release/Completion-System.html
# May need to call _complete with avoid-completer=_python-argcomplete or something like that
_default
return
fi
executable="${words[1]}"
req_argv=( "${words[@]:1}" )
fi
Expand Down Expand Up @@ -237,8 +243,5 @@ if [[ -z "${ZSH_VERSION-}" ]]; then
complete -o default -o bashdefault -D -F _python_argcomplete_global
else
autoload is-at-least
# Replace only the default completer (_default).
# There are many other special contexts we don't want to override.
# https://zsh.sourceforge.io/Doc/Release/Completion-System.html
compdef _python_argcomplete_global -default-
compdef _python_argcomplete_global -P '*'
fi

0 comments on commit 7771174

Please sign in to comment.