Open ruohola opened 7 months ago
I seem to be able to reproduce this behavior when the fzf
completion is enabled. Do you use fzf
? What is the result of the following command?
$ complete -p cd
The fzf
completion tries to wrap the completion settings that bash-completion sets. The fzf
completion defines its own cd
completion and tries to fall back to "the original completion" when the fzf
completion doesn't produce the completion candidates. The fzf
fetches "the original completion" on fzf
's loading time.
In bash-completion 2.11, we defined the completion setting in the main file (bash_completion
). In bash-completion 2.12, we started to dynamically load the completion setting for cd
on demand. For this reason, fzf
doesn't see the original completion set by bash-completion
when bash-completion
2.12 is used. Then, fzf
instead uses the default setting -o dirnames -o nospace
as a part of the original completion. This can be observed by running complete -p cd
with bash-completion
2.11 and 2.12:
With shopt -s autocd / bash-completion 2.11
$ complete -p cd
complete -o nospace -v -F _fzf_dir_completion cd
With shopt -s autocd / bash-completion 2.12
$ complete -p cd
complete -o dirnames -o nospace -F _fzf_dir_completion cd
The fzf
completion still tries to pick up the dynamically loaded completion setting, but it picks up only the completion function name, and the rest settings seem to be ignored.
@ruohola Is this problem solved with the latest version of fzf? If yes, can we close the issue?
Describe the bug
Autocompleting an cd'able alias (needs Bash option
shopt -s cdable_vars
to be set) does not work in version 2.12.0To reproduce
With this .bashrc:
with bash-completion@2 2.11 one could type
which would get autocompleted to
but with bash-completion@2 2.12.0 doing the same does not autocomplete any aliases. Autocompletion for normal directories works still fine.
Expected behavior
Autocompleting cd'able aliases should work fine.
Versions (please complete the following information)
echo "$BASH_VERSION"
: 5.2.26(1)-release(IFS=.; echo "${BASH_COMPLETION_VERSINFO[*]}")
: 2.12.0 (worked on 2.11)Additional context
I upgraded my brew packages one by one and can confirm that it worked right before upgrading bash-completion@2 and stopped right after that.
Debug trace
N/A