Message ID | 20200807221439.729-1-kuba@kadziolka.net |
---|---|
State | New |
Headers | show |
Series | [bug#42752,core-updates] gnu: bash: Make completions work in non-login shells. | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
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
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
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
Hi, Mathieu Othacehe <othacehe@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.
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"