[bash-completion, fzf] Breaks some bash-completions

ble version: 0.4.0-devel3+7d05a28 Bash version: 5.1.8(1)-release (x86_64-pc-linux-gnu)

Some tab completions are broken with For example nix-build -A<kbd>Tab</kbd> does not work at all and ssh ho<kbd>Tab</kbd> prefers files which contain the partial hostname instead of the parsed ssh_config results like bash_completions does. I currently have bleopt complete_auto_complete= set to work around this but I would like to know if this is the right solutions or those are bugs. Also sometimes directories no longer append a trailing slash even if not ambiguous which makes completing paths a lot harder since you manually need to append a slash every time.

You can find the source for the nix-build completion script here plus I am using this PR

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (11 by maintainers)

Most upvoted comments

Great! I could reproduce it. This is again caused by some interaction with fzf completion. I’ll later look at it.

The bug just found me again!

When I do cat ~/.config<kbd>Tab</kbd> nothing happens. That is not the case for echo ~/.config<kbd>Tab</kbd>.

$ complete -p cat
complete -F _fzf_path_completion cat
$ type cat
cat is a function
cat() {
  if [[ -p /dev/stdout || ! -t 1 || $* =~ --help ]]; then
    command cat "$@"
    _bat "$@"
cat is /usr/bin/cat
cat is /bin/cat

After doing ble-detach everything works again. I tried removing the function but that did not change something

$ type cat
cat is /usr/bin/cat
cat is /bin/ca

I think the culprit is ~. When changing to ~ and doing cat .config<kbd>Tab</kbd> the /is ammended.