[Bug 764288] New: bash-completion no longer works
https://bugzilla.novell.com/show_bug.cgi?id=764288 https://bugzilla.novell.com/show_bug.cgi?id=764288#c0 Summary: bash-completion no longer works Classification: openSUSE Product: openSUSE 12.2 Version: Milestone 3 Platform: x86-64 OS/Version: openSUSE 12.2 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: robert.munteanu@gmail.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0 $ rpm -q bash-completion bash-completion-1.99-1.1.noarch The enhanced shell completion no longer works for me in 12.2. I have tried rpm -q kern<TAB> ssh host<TAB> both of them worked with 12.1 . Reproducible: Always -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c
kk zhang
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c2
Marco Poletti
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c3
Christian Boltz
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c4
--- Comment #4 from Vincent Untz
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c5
--- Comment #5 from Vincent Untz
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c6
--- Comment #6 from Vincent Untz
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c7
Vincent Untz
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c8
Christian Boltz
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c9
Vincent Untz
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c10
Christian Boltz
Did you log out and log in again?
I updated aaa_base and bash-completion on 2012-06-28. Since then, I booted my laptop more than once. I guess this counts as fresh login? ;-) Some completions are available, but not too much: # complete | wc -l 50 # . /etc/profile.d/bash_completion.sh # complete | wc -l 432 A quick check tells me that the working 50 completions come from the files in /etc/bash_completion.d/ (for example completions for libreoffice, systemd, zypper)
If it still doesn't work, then we need something else.
Yes, seems so :-( I hope you get your hardware fixed/replaced soon!
FWIW, this worked fine on 12.1.
I know, and the package from 12.1 even works on 12.2 ;-) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c11
Takashi Iwai
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c12
--- Comment #12 from Vincent Untz
FWIW, this worked fine on 12.1.
I know, and the package from 12.1 even works on 12.2 ;-)
I meant the package from 12.2 with this fix works on 12.1 :-) So, obviously, one fix could be to change "true" with ". /etc/profile.d/bash_completion.sh" in the change I did for /etc/bash.bashrc Oh, btw, can you make sure you don't have a $HOME/.bash_completion or /etc/bash_completion anymore? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c13
Christian Boltz
So, obviously, one fix could be to change "true" with ". /etc/profile.d/bash_completion.sh" in the change I did for /etc/bash.bashrc
Indeed. I just edited my /etc/bash.bashrc - and completion works when I open a new tab in Konsole :-) In other words: Please apply the following patch: (not sure if testing for /usr/something and then sourcing /etc/something is a good idea - but I'll leave that decision up to you ;-) --- /etc/bash.bashrc_ORIG +++ /etc/bash.bashrc @@ -228,7 +228,7 @@ elif test -e /etc/bash_completion ; then . /etc/bash_completion elif test -d /usr/share/bash-completion ; then - true # /etc/profile.d/bash_completion.sh will do the right thing + . /etc/profile.d/bash_completion.sh elif test -s /etc/profile.d/complete.bash ; then . /etc/profile.d/complete.bash fi
Oh, btw, can you make sure you don't have a $HOME/.bash_completion or /etc/bash_completion anymore?
None of them exist. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c14
--- Comment #14 from Vincent Untz
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c15
--- Comment #15 from Takashi Iwai
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c16
--- Comment #16 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c17
--- Comment #17 from Christian Boltz
So, now, my question would be: why why why do we need to manually source /etc/profile.d/bash_completion.sh? Shouldn't it be read from /etc/profile.d anyway?
(obviously tested with the fix from comment #13 reverted) That's the theory, and that's also what is done from a login shell - for example, in a shell opened with "su - cb" bash-completion is working. That's because /etc/profile sources /etc/profile.d/*.sh However, if I call "bash" inside this login shell, the completion is missing again. That's because /etc/profile is not used this time (it's not a login shell). /etc/bash.bashrc does not source /etc/profile.d/*.sh, it only sources specific files in /etc/profile.d/. (Completion is not inherited from the parent bash to the child bash - only (exported) environments variable are inherited.) HTH ;-) (In reply to comment #15)
Hmm, it works for me with the updated aaa_base with Vincent's fix.
Did you test in a login shell or a "normal" shell?
Christian, did you really re-login after updates? /etc/profile checks $PROFILEREAD not to re-read /etc/profile.d/* files.
Yes - there were even several fresh boots between the update and testing. But see above - /etc/profile is only read by login shells, not by "normal" shells like those you get in KDE's Konsole. (In reply to comment #16)
Make /usr/share/bash-completion/bash_completion readable for all users not only root.
Hmm, it _is_ readable for all users on my system, and that's how it's packaged according to rpm -qlv.
Beside this if/etc/profile.d/bash_completion.sh exists then the lines
for s in /etc/bash_completion.d/*.sh ; do test -r $s && . $s done
from /etc/bash.bashrc can be removed.
Sure? ;-) Did you test it? (We already have enough breakage here, no need to break more ;-) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c18
--- Comment #18 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c19
--- Comment #19 from Vincent Untz
(In reply to comment #14)
So, now, my question would be: why why why do we need to manually source /etc/profile.d/bash_completion.sh? Shouldn't it be read from /etc/profile.d anyway?
(obviously tested with the fix from comment #13 reverted)
That's the theory, and that's also what is done from a login shell - for example, in a shell opened with "su - cb" bash-completion is working. That's because /etc/profile sources /etc/profile.d/*.sh
However, if I call "bash" inside this login shell, the completion is missing again. That's because /etc/profile is not used this time (it's not a login shell). /etc/bash.bashrc does not source /etc/profile.d/*.sh, it only sources specific files in /etc/profile.d/. (Completion is not inherited from the parent bash to the child bash - only (exported) environments variable are inherited.)
HTH ;-)
Ah, thanks for the explanation. It makes sense. But it also means we have several broken files in /etc/profile.d since they will get ignored in the same way for non-login shells (osc.sh, for instance). Hrm. So I guess there's no best solution than sourcing the file from bash.bashrc? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c20
--- Comment #20 from Takashi Iwai
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c21
--- Comment #21 from Christian Boltz
/suse/werner> ll /mounts/dist/unpacked/head-i586.full/usr/share/bash-completion/ -rw------- 1 root root 64047 Dec 8 2011 bash_completion [...] for this does not look like readable.
Strange. Can you please check from which package (rpm -q) this comes and confirm with rpm -qlv that the permissions are indeed set that way by the package? (In reply to comment #19)
Ah, thanks for the explanation. It makes sense. But it also means we have several broken files in /etc/profile.d since they will get ignored in the same way for non-login shells (osc.sh, for instance). Hrm.
Nice[tm]. Do we need separate bugreports for them or one solution that works for all? (Basically everything that does more than "export foo" is probably broken for non-login shells.)
So I guess there's no best solution than sourcing the file from bash.bashrc?
Yes, for 12.2 sourcing from bash.bashrc is the best (only?) solution. (In reply to comment #20)
I think it's then anyway wrong to use /etc/profile.d for bash-completion setup. /etc/bash.bashrc is sourced from /etc/profile, so it should suffice to setup completions there.
Probably yes, but please test it ;-) On the longer term - what about a directory /etc/bash.d/ ? (similar to /etc/profile.d/, but sourced via bash.bashrc) Or would a more generic solution for all shells make more sense? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c22
--- Comment #22 from Vincent Untz
(In reply to comment #19)
Ah, thanks for the explanation. It makes sense. But it also means we have several broken files in /etc/profile.d since they will get ignored in the same way for non-login shells (osc.sh, for instance). Hrm.
Nice[tm]. Do we need separate bugreports for them or one solution that works for all? (Basically everything that does more than "export foo" is probably broken for non-login shells.)
I think we need a long-term solution -- it'll continue to happen that people put files in this directory and expect things to work. Maybe /etc/bash.d, as you suggested, is the proper approach? Can you take care of filing a bug, a feature, or driving the discussion on the list? (I'll fix aaa_base again for this bug in the mean time) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c23
Vincent Untz
https://bugzilla.novell.com/show_bug.cgi?id=764288
https://bugzilla.novell.com/show_bug.cgi?id=764288#c24
--- Comment #24 from Bernhard Wiedemann
participants (1)
-
bugzilla_noreply@novell.com