environment: Avoid false positive on 'PS1' check.
* guix/scripts/environment.scm (validate-child-shell-environment): Do not warn when 'PS1' refers to 'GUIX_ENVIRONMENT'.
This commit is contained in:
parent
632e2f7ce1
commit
b5e3701f1a
1 changed files with 6 additions and 1 deletions
|
@ -601,7 +601,12 @@ environment~%")))
|
||||||
(match (vhash-assoc "PS1" actual)
|
(match (vhash-assoc "PS1" actual)
|
||||||
(#f #f)
|
(#f #f)
|
||||||
((_ . str)
|
((_ . str)
|
||||||
(when (and (getenv "PS1") (string=? str (getenv "PS1")))
|
(when (and (getenv "PS1") (string=? str (getenv "PS1"))
|
||||||
|
|
||||||
|
;; 'PS1' might be conditional on 'GUIX_ENVIRONMENT', as
|
||||||
|
;; shown in the hint below.
|
||||||
|
(not (or (string-contains str "$GUIX_ENVIRONMENT")
|
||||||
|
(string-contains str "${GUIX_ENVIRONMENT"))))
|
||||||
(warning (G_ "'PS1' is the same in sub-shell~%"))
|
(warning (G_ "'PS1' is the same in sub-shell~%"))
|
||||||
(display-hint (G_ "Consider setting a different prompt for
|
(display-hint (G_ "Consider setting a different prompt for
|
||||||
environment shells to make them distinguishable.
|
environment shells to make them distinguishable.
|
||||||
|
|
Reference in a new issue