[Bug 2072618] [NEW] User-local Bash completions not loading

Lucas Sandery 2072618 at bugs.launchpad.net
Wed Jul 10 03:27:54 UTC 2024


Public bug reported:

I'm on Noble. I don't believe there's anything special about my
environment with respect to Bash completions. I had pipx installed to
prevent conflicts with the system python, which brings in the
python3-argcomplete package. I've temporarily removed the former but
kept the latter, in order to investigate my problem.

When argcomplete is installed, completions in ~/.local/share/bash-
completion/completions/ do not load or run. Their underscore-prefixed
functions do not appear in the environment. To test, I created a file
there for the non-existent command "zz", with these contents:

_zz () {
    COMPREPLY=($(compgen -W 'foo bar baz qux' -- "$2"))
} && complete -F _zz zz

At a fresh Bash prompt, I type "zz " then hit Tab. It will only complete
filenames from the current dir, not from the specified argument set.
Under "bash -x", the trace after doing so begins with this:

+ [[ -n '' ]]
+ local _BASH_REMATCH=
+ local executable=
+ req_argv=()
+ local req_argv
+ [[ -z '' ]]
+ executable=zz
+ req_argv=("" "${COMP_WORDS[@]:1}")
+ __python_argcomplete_expand_tilde_by_ref executable
...

If I uninstall the argcomplete package and do the same, fresh prompt
each time, my completions work again. I can reliably toggle this
behaviour by reinstalling & uninstalling it. The successful trace begins
with this:

+ local cmd=zz
+ __load_completion zz
+ dirs=('/home/l/.local/share/bash-completion/completions')
+ local -a dirs
...

** Affects: bash-completion (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: python-argcomplete (Ubuntu)
     Importance: Undecided
         Status: New

** Also affects: bash-completion (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash-completion in Ubuntu.
https://bugs.launchpad.net/bugs/2072618

Title:
  User-local Bash completions not loading

Status in bash-completion package in Ubuntu:
  New
Status in python-argcomplete package in Ubuntu:
  New

Bug description:
  I'm on Noble. I don't believe there's anything special about my
  environment with respect to Bash completions. I had pipx installed to
  prevent conflicts with the system python, which brings in the
  python3-argcomplete package. I've temporarily removed the former but
  kept the latter, in order to investigate my problem.

  When argcomplete is installed, completions in ~/.local/share/bash-
  completion/completions/ do not load or run. Their underscore-prefixed
  functions do not appear in the environment. To test, I created a file
  there for the non-existent command "zz", with these contents:

  _zz () {
      COMPREPLY=($(compgen -W 'foo bar baz qux' -- "$2"))
  } && complete -F _zz zz

  At a fresh Bash prompt, I type "zz " then hit Tab. It will only
  complete filenames from the current dir, not from the specified
  argument set. Under "bash -x", the trace after doing so begins with
  this:

  + [[ -n '' ]]
  + local _BASH_REMATCH=
  + local executable=
  + req_argv=()
  + local req_argv
  + [[ -z '' ]]
  + executable=zz
  + req_argv=("" "${COMP_WORDS[@]:1}")
  + __python_argcomplete_expand_tilde_by_ref executable
  ...

  If I uninstall the argcomplete package and do the same, fresh prompt
  each time, my completions work again. I can reliably toggle this
  behaviour by reinstalling & uninstalling it. The successful trace
  begins with this:

  + local cmd=zz
  + __load_completion zz
  + dirs=('/home/l/.local/share/bash-completion/completions')
  + local -a dirs
  ...

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/2072618/+subscriptions




More information about the foundations-bugs mailing list