Hello Jürgen, thanks for following up on this bug.
On Mon, 23 Aug 2021 13:11:28 +0200 Jürgen Kuri <juergen.k...@ionos.com> wrote: > > If have() is used AND bash-completion script is stored into directory > > /usr/share/bash-completion/completions I'm still trying to reproduce the problem, so... I copied the file that you attached to message #15 [1,2] into /usr/share/bash-completion/completions/fsmtool2, as can be verified in the following snippet: $ head /usr/share/bash-completion/completions/fsmtool2 have fsmtool2 && { _fsmtool2_commands() { COMPREPLY=( $(compgen -W "help showconfig showfiles showfileslex deleteall" -- $1) ) } _fsmtool2() { local areas command cur cur=${COMP_WORDS[COMP_CWORD]} command=${COMP_WORDS[1]} Then, I tried basic completion: $ fsmtool2 <TAB><TAB> deleteall help showconfig showfiles showfileslex i.e.: it completes with the basic commands correctly. If I try to complete the second word, then it doesn't work, but that's because I don't have the configuration file under /etc and I believe that this is unrelated to your problem: $ fsmtool2 showconfig <TAB> grep: /etc/fsmd2/fsmd2.conf: No such file or directory > completion does not work anymore. Perhaps this only works for me because I'm running sid and testing? But it does work for me. I will create a chroot with old-stable (buster) to check if older versions of bash-completion have this problem. > If we replace have() by _have() or simply remove it in the bash completion > script (like many other do) it will work in both storage paths. Can you do that? I mean, does it fix the problems you are hitting? While I understand that installing things under /etc/bash_completion.d/ made things work for you, we can't change dh_bash-completion to install things under that directory. dh_bash-completion must install to /usr/share/bash-completion/completions. Cheers, Gabriel [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961660#15 [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=961660;filename=fsmtool2-completion;msg=15