Bug#1034567: bash-completion: Doesn't work for root in non-login shell (on default settings)
/var/lib/dpkg/info/base-files.postinst installs /root/.bashrc from /usr/share/base-files/dot.bashrc . So /root/.bashrc is owned by base-files . I found this is already reported to base-files: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=275623 . And moreover there is a message on bash-completion there, which CC you: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=275623#58 . -- Askar Safin
Bug#1034567: bash-completion: Doesn't work for root in non-login shell (on default settings)
On Wed, 19 Apr 2023 22:45:21 +0300 Askar Safin wrote: > > (But I still think we should just make /etc/skel/.bashrc to be default > /root/.bashrc . This will fix other possible "user vs root" bugs. > Currently /root/.bashrc doesn't have any non-comment lines, i. e. it > doesn't contain anything useful anyway.) I believe that bash-completion has no influence over /root/.bashrc. Actually, I don't even know which package owns /root/.bashrc (dpkg --search /root/.bashrc returns nothing); I assumed it was owned by the bash package, and I was planning on reassigning this bug to them to get some feedback, but apparently I was wrong.
Bug#1034567: bash-completion: Doesn't work for root in non-login shell (on default settings)
I just did a little research. In sid chain for login shell for root is so: "bash --login" -> /etc/profile -> /etc/profile.d/bash_completion.sh -> /usr/share/bash-completion/bash_completion (But I still think we should just make /etc/skel/.bashrc to be default /root/.bashrc . This will fix other possible "user vs root" bugs. Currently /root/.bashrc doesn't have any non-comment lines, i. e. it doesn't contain anything useful anyway.) (Also this time I got your email properly.) -- Askar Safin
Bug#1034567: bash-completion: Doesn't work for root in non-login shell (on default settings)
On Wed, 19 Apr 2023 17:10:06 +0300 Askar Safin wrote: > If I copy /etc/skel/.bashrc to /root/.bashrc , the bug disappears. That's because /etc/skel/.bashrc directly source /etc/bash_completion. With login shells, /etc/bash_completion gets sourced by something else. I think we need to dig deeper.
Bug#1034567: bash-completion: Doesn't work for root in non-login shell (on default settings)
If I copy /etc/skel/.bashrc to /root/.bashrc , the bug disappears. Let's simply make /root/.bashrc to be a copy of /etc/skel/.bashrc . This will remove all "root vs user" bugs. P. S. For unknown reasons I didn't get your email, I discovered it by chance. I will try to report this to bugs.debian.org bug tracker -- Askar Safin
Bug#1034567: bash-completion: Doesn't work for root in non-login shell (on default settings)
Control: tags -1 confirmed Steps to reproduce $ su -# become root # echo $0 -bash # this is a login shell # apt-get inst (completes) # su root # echo $0 bash # this is a non-login shell # apt-get inst (nothing happens) I don't currently know what sources /etc/bash_completion in the login shell. I'll try to figure it out. On Tue, 18 Apr 2023 12:31:04 + Askar Safin wrote: > Package: bash-completion > Version: 1:2.11-6 > Severity: normal > X-Debbugs-Cc: safinas...@gmail.com > > bash-completion (for example, "apt-get inst") doesn't work for root in > non-login shell on default settings. Completion works for normal users. > And completion works in login shells. > > > > -- System Information: > Debian Release: bookworm/sid > APT prefers unstable > APT policy: (500, 'unstable') > Architecture: amd64 (x86_64) > > Kernel: Linux 5.10.0-0.deb9.21-amd64 (SMP w/4 CPU threads) > Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set > Shell: /bin/sh linked to /usr/bin/dash > Init: unable to detect > > -- no debconf information
Bug#1034567: bash-completion: Doesn't work for root in non-login shell (on default settings)
Package: bash-completion Version: 1:2.11-6 Severity: normal X-Debbugs-Cc: safinas...@gmail.com bash-completion (for example, "apt-get inst") doesn't work for root in non-login shell on default settings. Completion works for normal users. And completion works in login shells. -- System Information: Debian Release: bookworm/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 5.10.0-0.deb9.21-amd64 (SMP w/4 CPU threads) Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/dash Init: unable to detect -- no debconf information