[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#60365] [PATCH 0/4] Rationalize 'PS1' handling in home, system, and
From: |
Ludovic Courtès |
Subject: |
[bug#60365] [PATCH 0/4] Rationalize 'PS1' handling in home, system, and shell |
Date: |
Tue, 03 Jan 2023 23:46:53 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Hi Andrew!
Andrew Tropin <andrew@trop.in> skribis:
>> I found some things could be improved in how we deal with ‘PS1’ in
>> Guix Home, Guix System, and ‘guix shell’ (my initial motivation was
>> making it easy to change ‘PS1’ from a Home configuration).
>>
>> These patches fiddle with ‘PS1’. The most visible effect is that
>> Guix Home’s ~/.bashrc will no longer provide a default ‘PS1’.
>>
>> Thoughts?
>
> Factorization of bashrc is great!
>
> Not sure about moving PS1 to /etc/bashrc as it won't work on foreign
> distros and guix environment won't be noticable in the prompt. Warning
> is useful, but I would expect prompt work OOB, when guix-defualts? is
> #t.
Yes, you’re right.
> The possible alternative solution is to factorize bash_profile and put
> PS1 here, so both skeleton and home provided bashrc have it, after that
> setting PS1 with environment-variables field will start working.
How about this:
diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm
index d7dd579293..8d7db6b774 100644
--- a/gnu/home/services/shells.scm
+++ b/gnu/home/services/shells.scm
@@ -407,6 +407,9 @@ (define* (file-if-not-empty field #:optional (extra-content
#f))
# Honor per-interactive-shell startup file
if [ -f ~/.bashrc ]; then source ~/.bashrc; fi
"
+ (if (home-bash-configuration-guix-defaults? config)
+ "export PS1=...\n"
+ "")
(serialize-field 'bash-profile)
(serialize-field 'environment-variables)))
That way, if one adds ‘PS1’ to ‘environment-variables’, that will
override the default.
WDYT?
Thanks for your feedback!
Ludo’.
- [bug#60365] [PATCH 0/4] Rationalize 'PS1' handling in home, system, and shell,
Ludovic Courtès <=
- Prev by Date:
[bug#51415] [PATCH] In the Artanis package the propagated input of guile-json is conflicting with guix, and no series of guix upgrades or guix installs seems to fix this. Therefore, I moved guile-json from a propagated input to an input, which solves the issue, but may not be ideal for people who don't wish to keep multiple copies of guile-json
- Next by Date:
[bug#60341] [PATCH Home] home: services: environment-variables: Add support for literal strings.
- Previous by thread:
[bug#51415] [PATCH] In the Artanis package the propagated input of guile-json is conflicting with guix, and no series of guix upgrades or guix installs seems to fix this. Therefore, I moved guile-json from a propagated input to an input, which solves the issue, but may not be ideal for people who don't wish to keep multiple copies of guile-json
- Next by thread:
[bug#60365] [PATCH 0/4] Rationalize 'PS1' handling in home, system, and shell
- Index(es):