[Bash-completion-devel] Bug#678174: bash-completion: /etc/profile.d/bash_completion.sh does not work for non-login shells (e.g., screen, xterm)

Matthijs Kooijman matthijs at stdin.nl
Tue Jun 19 18:28:22 UTC 2012


Package: bash-completion
Version: 1:1.99-3
Severity: minor

Hi folks,

as was already mentioned in an aside in #593835: It's nice that
bash_completion is now enabled by default through /etc/profile.d, but
this only works for login shells. In particular, shells running in a
screen session or a terminal emulator like xterm, don't get bash
completion enabled right now.

This can cause confusion for users, when completion works in one shell,
but not the other. Also, when trying to fix this by enabling
bash_completion in /etc/bash.bashrc, it is enabled twice for login
shells, leading to extra login delays (though it seems
/etc/profile.d/bash_completion bails out if it's already loaded, so I
guess I've imagined this...).

I am aware that this issue is ultimately caused by how /etc/profile[.d]
works, and I do not know of any way to easily fix this (but that doesn't
mean there is none).

It seems to me that the best place to put the enabling code is in
/etc/bash.bashrc, but that's of course not up to the bash-completion
package.

One thing that springs to mind is to have bash offer an
/etc/bash.bashrc.d directory similar to /etc/profile.d, so
bash-completion can ship a hook in there instead of in /etc/profile.d.
Seems there's already a wishlist bug for that against bash: #675008.

Gr.

Matthijs





More information about the Bash-completion-devel mailing list