Package: bash
Version: 5.1-3
Severity: wishlist

Hey there.

Currently, /etc/bash.bashrc (where it's commented though) and /etc/skel/.bashrc
use the following to enable bash-completion:
>if ! shopt -oq posix; then
>  if [ -f /usr/share/bash-completion/bash_completion ]; then
>    . /usr/share/bash-completion/bash_completion
>  elif [ -f /etc/bash_completion ]; then
>    . /etc/bash_completion
>  fi
>fi

It would be nice, if instead of this, something like the following could be 
used.
>if [ -f /etc/profile.d/bash_completion.sh ]; then
>       . /etc/profile.d/bash_completion.sh
>fi

That file is shipped by bash-completion, so when the original code would work,
it's also guaranteed to be there.


It also does some checks like whether the shell is interactive, whether
bash-completion has already been sourced and so on.

Plus it's what any login shell does, where that file is sourced already - at 
least
with Debian's default /etc/profile.
And I think it's a good idea, if it's guaranteed when the two do the same.


btw: It *is* still necessary to source the file from within .bashrc, cause
/etc/profile isn't sourced on non-login shells (i.e. terminal launched from a
desktop environment)



Cheers,
Chris.

Reply via email to