Bug 1789958 - Bash completion installed in incorrect directory
Summary: Bash completion installed in incorrect directory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: fzf
Version: 31
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-10 20:26 UTC by Ralf Ertzinger
Modified: 2020-03-05 01:20 UTC (History)
3 users (show)

Fixed In Version: fzf-0.20.0-2.fc31 fzf-0.20.0-2.fc30
Clone Of:
Environment:
Last Closed: 2020-01-17 05:07:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ralf Ertzinger 2020-01-10 20:26:14 UTC
Description of problem:
The package installs bash completion information into
/usr/share/bash-completion/completions/fzf.

This location is incorrect for this specific case. That file does not contain completions for the fzf command per se (which would be what this directory
is for), but enables completion for cases like

vim **<TAB>

which would open a fzf prompt to select files to add to the command line.

As such, this file needs to be located in the /etc/bash_completion.d/
directory instead.

Version-Release number of selected component (if applicable):
fzf-0.19.0-1.fc31.x86_64

How reproducible:
Always

Steps to Reproduce:
1. install fzf
2. type "vim **<tab>"
3.

Actual results:
Nothing happens, or a single file name gets completed

Expected results:
A fzf prompt gets opened

Additional info:

Comment 1 Robert-André Mauchin 🐧 2020-01-11 16:47:03 UTC
Hi thanks for the report, I've taken your advice and pushed an update to F30-F32.

Comment 2 Fedora Update System 2020-01-12 01:24:31 UTC
fzf-0.20.0-2.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-604c23048f

Comment 3 Fedora Update System 2020-01-12 02:08:14 UTC
fzf-0.20.0-2.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-30d859262f

Comment 4 Fedora Update System 2020-01-17 05:07:15 UTC
fzf-0.20.0-2.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2020-01-20 03:19:22 UTC
fzf-0.20.0-2.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.

Comment 6 Elliott Sales de Andrade 2020-01-28 18:23:47 UTC
What exactly describes what goes in which directory? Because this is the exact opposite of what bug 1683868 asked to do.

Comment 7 Ralf Ertzinger 2020-01-28 21:20:42 UTC
The way bash-completion loads things is a bit... convoluted. It definitely predates the "/etc is for local changes, /usr is for distribution stuff" that's kinda prevalent today.

The basic call chain is /etc/profile.d/bash_completion.sh -> /usr/share/bash-completion/bash_completion -> /etc/bash_completion.d/*

Everything in /etc/bash_completion.d always gets loaded.

/usr/share/bash-completion/bash_completion _also_ sets up a dynamic handler that can load completions for specific programs when the user first tries autocomplete on them. Those get loaded from /usr/share/bash-completion/completions on demand. So if you want completion for program xfoo, a file can be put in /usr/share/bash-completion/completions/xfoo, and bash-completion will load it the first time you type "xfoo <tab>". This saves bash-completion from loading all possible completions in advance.

The thing about fzf is that its autocompletion "<command> **<tab>" is not something that is tied to the fzf command itself, because it can autocomplete many programs for the specific ** pattern. For this to work, the completion logic needs to be always loaded, and needs to reside in /etc/bash_completion.d.

To the best of my knowledge, while /etc/bash_completion.d is called "compat", there's no other directory for this purpose.

If there is documentation about all this I don't know where it is.

Comment 8 Elliott Sales de Andrade 2020-03-05 01:20:17 UTC
Thanks for the explanation. I had noticed that some completions weren't work, but forgot/didn't have time to investigate.


Note You need to log in before you can comment on or make changes to this bug.