Menu

#290 Not compatible with bash-completion 2.14.0

v0.9.32
closed
nobody
None
1
2024-07-06
2024-06-10
Jozef Riha
No

On ever since I updated bash-completion to 2.14.0 (from 2.11) on my Arch system, I am getting the following while tuxpaint-completion.bash is loaded:

have: command not found

It's a bit odd though that this only happens with Czech and Slovak locales. After receiving the error the completion for tuxpaint is not working.

$ export LC_ALL=en_US.utf8
$ bash
$ # no error

$ export LC_ALL=sk_SK.utf8
$ bash
bash: have: príkaz nenájdený
(translates to command not found)

$ export LC_ALL=cs_CZ.utf8
$ bash
bash: have: příkaz nenalezen
(translates to command not found)

This may also be an issue of bash-completion itself - perhaps someone has an idea what's going on. For now the downgrade to 2.11 solves the problem.

Discussion

  • William Kendrick

     
  • William Kendrick

    Briefly Googling around it seems have was deprecated. I'm replacing it with _have. Can you try modifying your tuxpaint-completion.bash in the same way and check that it works under bash-completion 2.14? (I'm on Ubuntu 22.04 here, with 2.11, so unable to replicate it, even if I switch to e.g. cs_CZ locale.)

    https://sourceforge.net/p/tuxpaint/tuxpaint/ci/71959d502ef17e594ba69f3344c17119ea4c0416/

     
  • Jozef Riha

    Jozef Riha - 2024-07-04

    Hello William,

    the problem on my system is as follows:

    # ls -1 /etc/bash_completion.d
    tuxpaint-completion.bash
    000_bash_completion_compat.bash
    

    As can be observed tuxpaint-completion.bash is sourced before 000_bash_completion_compat.bash while it's the latter file that contains the definition of the _have function:

    # grep _have 000_bash_completion_compat.bash | head -1
    _comp_deprecate_func 2.12 _have _comp_have_command
    

    I see two possible workarounds:
    - rename tuxpaint-completion.bash to 010_tuxpaint-completion.bash to make sure it gets loaded after bash_completion
    - use _comp_have_command instead of _have (as it seems to just be a wrapper around it:

     # type _have
    _have is a function
    _have () 
    { 
        _comp_have_command "$@"
    }
    
     
  • Jozef Riha

    Jozef Riha - 2024-07-04

    And the reason why you may get different output with different locales:

    # LANG=C ls -1
    000_bash_completion_compat.bash
    tuxpaint-completion.bash
    
    vs
    
    # LANG=sk_SK.utf8 ls -1
    tuxpaint-completion.bash
    000_bash_completion_compat.bash
    
     

    Last edit: Jozef Riha 2024-07-04
  • William Kendrick

    So this seems to have been a known bug in bash-completion (https://github.com/scop/bash-completion/issues/1207). That said, since it's obviously out in the wild and affecting people, I'll go with the rename route (010_tuxpaint-completion.bash). Thanks!

     
  • William Kendrick

    • status: open --> closed
     

Log in to post a comment.