unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#70205] [PATCH] home: services: bash: Move default PS1 prompt to bashrc
@ 2024-04-04 22:53 Richard Sent
  0 siblings, 0 replies; only message in thread
From: Richard Sent @ 2024-04-04 22:53 UTC (permalink / raw)
  To: 70205; +Cc: Richard Sent

Reported in <https://issues.guix.gnu.org/70164>.

* home/services/shells.scm (add-bash-configuration): Move default PS1 prompt
from .bash_profile to .bashrc.

Change-Id: Ic437458ee362cc4aa803a71c9962af866749f59a
---
Hi Guix!

See the issue mentioned in the commit message for the motivation for
this patch.

 gnu/home/services/shells.scm | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index 8fd1668b59..a5b2586dde 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -415,14 +415,6 @@ (define (add-bash-configuration config)
 if [ -f ~/.bashrc ]; then source ~/.bashrc; fi
 "
 
-        ;; The host distro might provide a bad 'PS1' default--e.g., not taking
-        ;; $GUIX_ENVIRONMENT into account.  Provide a good default here when
-        ;; asked to.  The default can be overridden below via
-        ;; 'environment-variables'.
-        (if (home-bash-configuration-guix-defaults? config)
-            "PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '\n"
-            "")
-
         (serialize-field 'bash-profile)
         (serialize-field 'environment-variables)))
 
@@ -430,6 +422,10 @@ (define (add-bash-configuration config)
               'bashrc
               (if (home-bash-configuration-guix-defaults? config)
                   (list (plain-file-content %default-bashrc)
+                        ;; The host distro might provide a bad 'PS1'
+                        ;; default--e.g., not taking $GUIX_ENVIRONMENT into
+                        ;; account.  Provide a good default here when asked.
+                        "PS1='\\u@\\h \\w${GUIX_ENVIRONMENT:+ [env]}\\$ '"
                         (serialize-field 'aliases))
                   (list (serialize-field 'aliases))))
              (file-if-not-empty 'bash-logout)))))

base-commit: ade6845da6cec99f3bca46faac9b2bad6877817e
-- 
2.41.0





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-04 22:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-04 22:53 [bug#70205] [PATCH] home: services: bash: Move default PS1 prompt to bashrc Richard Sent

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).