GNU bug report logs - #42752
[PATCH core-updates] gnu: bash: Make completions work in non-login shells.

Previous Next

Package: guix-patches;

Reported by: Jakub Kądziołka <kuba <at> kadziolka.net>

Date: Fri, 7 Aug 2020 22:15:01 UTC

Severity: normal

Tags: notabug, patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42752 in the body.
You can then email your comments to 42752 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#42752; Package guix-patches. (Fri, 07 Aug 2020 22:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 07 Aug 2020 22:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: guix-patches <at> gnu.org
Subject: [PATCH core-updates] gnu: bash: Make completions work in non-login
 shells.
Date: Sat,  8 Aug 2020 00:14:39 +0200
Currently, /etc/bashrc is only loaded by /etc/profile. Because the
former is responsible for setting up command-specific completions, they
currently only work in login shells. This patch configures bash to load
/etc/bashrc in interactive non-login shells, as by default no
system-wide configuration is loaded.

* gnu/packages/bash.scm (bash): Set SYS_BASHRC to /etc/bashrc.
---
 gnu/packages/bash.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/bash.scm b/gnu/packages/bash.scm
index 47ca625d9a..9784e2ccc1 100644
--- a/gnu/packages/bash.scm
+++ b/gnu/packages/bash.scm
@@ -108,7 +108,8 @@ number/base32-hash tuples, directly usable in the 'patch-series' form."
   (let* ((cppflags (string-join '("-DDEFAULT_PATH_VALUE='\"/no-such-path\"'"
                                   "-DSTANDARD_UTILS_PATH='\"/no-such-path\"'"
                                   "-DNON_INTERACTIVE_LOGIN_SHELLS"
-                                  "-DSSH_SOURCE_BASHRC")
+                                  "-DSSH_SOURCE_BASHRC"
+                                  "-DSYS_BASHRC='\"/etc/bashrc\"'")
                                 " "))
          (configure-flags
           ``("--with-installed-readline"
-- 
2.28.0





Information forwarded to guix-patches <at> gnu.org:
bug#42752; Package guix-patches. (Mon, 10 Aug 2020 09:26:02 GMT) Full text and rfc822 format available.

Message #8 received at 42752 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Jakub Kądziołka <kuba <at> kadziolka.net>
Cc: 42752 <at> debbugs.gnu.org
Subject: Re: [bug#42752] [PATCH core-updates] gnu: bash: Make completions work
 in non-login shells.
Date: Mon, 10 Aug 2020 11:25:12 +0200
Hey Jakub,

> Currently, /etc/bashrc is only loaded by /etc/profile. Because the
> former is responsible for setting up command-specific completions, they
> currently only work in login shells. This patch configures bash to load
> /etc/bashrc in interactive non-login shells, as by default no
> system-wide configuration is loaded.

/etc/bashrc is also loaded by ~/.bashrc in "default-skeletons". So your
patch would cover the case of an interactive, non-login shell run by a
logged in user without the default ~/.bashrc file, right?

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#42752; Package guix-patches. (Mon, 10 Aug 2020 14:42:02 GMT) Full text and rfc822 format available.

Message #11 received at 42752 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 42752 <at> debbugs.gnu.org
Subject: Re: [bug#42752] [PATCH core-updates] gnu: bash: Make completions
 work in non-login shells.
Date: Mon, 10 Aug 2020 16:41:41 +0200
[Message part 1 (text/plain, inline)]
On Mon, Aug 10, 2020 at 11:25:12AM +0200, Mathieu Othacehe wrote:
> 
> Hey Jakub,
> 
> > Currently, /etc/bashrc is only loaded by /etc/profile. Because the
> > former is responsible for setting up command-specific completions, they
> > currently only work in login shells. This patch configures bash to load
> > /etc/bashrc in interactive non-login shells, as by default no
> > system-wide configuration is loaded.
> 
> /etc/bashrc is also loaded by ~/.bashrc in "default-skeletons". So your
> patch would cover the case of an interactive, non-login shell run by a
> logged in user without the default ~/.bashrc file, right?

Oh! It seems I overwrote it with my own .bashrc when I migrated my
dotfiles. I still think this patch is a good idea - I think we should
make /etc/skel/.bashrc contain only nice-to-have defaults, such as
changing the prompt based on $GUIX_ENVIRONMENT, and move the essential
things to /etc/bashrc. That way, overwriting the .bashrc won't break
anything important.

I guess I should follow this patch up with an adjustment to
/etc/skel/.bashrc, removing the 'source /etc/bashrc' line?

Regards,
Jakub Kądziołka
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#42752; Package guix-patches. (Tue, 11 Aug 2020 08:45:02 GMT) Full text and rfc822 format available.

Message #14 received at 42752 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Jakub Kądziołka <kuba <at> kadziolka.net>
Cc: 42752 <at> debbugs.gnu.org
Subject: Re: [bug#42752] [PATCH core-updates] gnu: bash: Make completions work
 in non-login shells.
Date: Tue, 11 Aug 2020 10:44:37 +0200
Hello,

> Oh! It seems I overwrote it with my own .bashrc when I migrated my
> dotfiles. I still think this patch is a good idea - I think we should
> make /etc/skel/.bashrc contain only nice-to-have defaults, such as
> changing the prompt based on $GUIX_ENVIRONMENT, and move the essential
> things to /etc/bashrc. That way, overwriting the .bashrc won't break
> anything important.
>
> I guess I should follow this patch up with an adjustment to
> /etc/skel/.bashrc, removing the 'source /etc/bashrc' line?

That would make sense. Maybe you could replace the sourcing by a comment
explaining how bash behaviour is altered to source /etc/bashrc for
interactive, non-login shell.

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#42752; Package guix-patches. (Sat, 21 Oct 2023 19:25:02 GMT) Full text and rfc822 format available.

Message #17 received at 42752 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: Jakub Kądziołka <kuba <at> kadziolka.net>,
 42752 <at> debbugs.gnu.org
Subject: Re: bug#42752: [PATCH core-updates] gnu: bash: Make completions
 work in non-login shells.
Date: Sat, 21 Oct 2023 15:24:02 -0400
Hi,

Mathieu Othacehe <othacehe <at> gnu.org> writes:

> Hello,
>
>> Oh! It seems I overwrote it with my own .bashrc when I migrated my
>> dotfiles. I still think this patch is a good idea - I think we should
>> make /etc/skel/.bashrc contain only nice-to-have defaults, such as
>> changing the prompt based on $GUIX_ENVIRONMENT, and move the essential
>> things to /etc/bashrc. That way, overwriting the .bashrc won't break
>> anything important.
>>
>> I guess I should follow this patch up with an adjustment to
>> /etc/skel/.bashrc, removing the 'source /etc/bashrc' line?
>
> That would make sense. Maybe you could replace the sourcing by a comment
> explaining how bash behaviour is altered to source /etc/bashrc for
> interactive, non-login shell.

I somewhat weary of the undefined behavior this could have on foreign
distributions?

I'll close this, but feel free to continue discussing it here.

-- 
Thanks,
Maxim




Added tag(s) notabug. Request was from Maxim Cournoyer <maxim.cournoyer <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 21 Oct 2023 19:25:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 42752 <at> debbugs.gnu.org and Jakub Kądziołka <kuba <at> kadziolka.net> Request was from Maxim Cournoyer <maxim.cournoyer <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 21 Oct 2023 19:25:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 19 Nov 2023 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 157 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.