mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
profiles: Preserve Bash ‘HIST’ variables.
This reduces the risk that, when using Bash, ‘guix shell --pure’ would spawn an instance of Bash that would ignore the user’s history-related settings. It is not bulletproof though: these variables as shell variables that need not be exported as environment variable. When they are not exported, the user’s history-related settings would still be ignored. * guix/profiles.scm (%precious-variables): Add HIST variables from Bash. Change-Id: Id2898d67d2e70c083abbeacad3f0663940fb6789
This commit is contained in:
parent
a65c691b39
commit
e778155f51
1 changed files with 9 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013-2024 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2013-2025 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
|
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
|
||||||
;;; Copyright © 2014, 2016 Alex Kost <alezost@gmail.com>
|
;;; Copyright © 2014, 2016 Alex Kost <alezost@gmail.com>
|
||||||
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
||||||
|
@ -2136,7 +2136,14 @@ already effective."
|
||||||
|
|
||||||
(define %precious-variables
|
(define %precious-variables
|
||||||
;; Environment variables in the default 'load-profile' white list.
|
;; Environment variables in the default 'load-profile' white list.
|
||||||
'("HOME" "USER" "LOGNAME" "DISPLAY" "XAUTHORITY" "TERM" "TZ" "PAGER"))
|
'("HOME" "USER" "LOGNAME" "DISPLAY" "XAUTHORITY" "TERM" "TZ" "PAGER"
|
||||||
|
|
||||||
|
;; These Bash variables (which can also be environment variables) must be
|
||||||
|
;; preserved. Failure to preserve 'HISTSIZE', for instance, would lead
|
||||||
|
;; Bash to use its default history size of 500 entries, possibly
|
||||||
|
;; truncating the user's ~/.bash_history.
|
||||||
|
"HISTCONTROL" "HISTFILE" "HISTFILESIZE" "HISTIGNORE"
|
||||||
|
"HISTSIZE" "HISTTIMEFORMAT"))
|
||||||
|
|
||||||
(define (purify-environment white-list white-list-regexps)
|
(define (purify-environment white-list white-list-regexps)
|
||||||
"Unset all environment variables except those that match the regexps in
|
"Unset all environment variables except those that match the regexps in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue