From: Yu Watanabe Date: Wed, 6 Aug 2025 05:49:43 +0000 (+0900) Subject: profile: replace default bash prompt with more informative one X-Git-Tag: v258-rc3~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0dc0bf4caf267c49be3d574ba9d10a43bebc7465;p=thirdparty%2Fsystemd.git profile: replace default bash prompt with more informative one The default bash PS1 provides mostly no information. Let's replace it. Before: ``` [watanabe@thinkpad-x280:~] $ run0 🦸 bash-5.2# echo $PS1 🦸 \s-\v\$ ``` After: ``` [watanabe@thinkpad-x280:~] $ run0 🦸 [root@thinkpad-x280 watanabe]# echo $PS1 🦸 [\u@\h \W]\$ ``` Fixes #38494. --- diff --git a/profile.d/70-systemd-shell-extra.sh b/profile.d/70-systemd-shell-extra.sh index dae77e4bc76..46dd82d9ce1 100644 --- a/profile.d/70-systemd-shell-extra.sh +++ b/profile.d/70-systemd-shell-extra.sh @@ -13,10 +13,16 @@ # are propagated into these environment variables by pam_systemd(8). if [ -n "${SHELL_PROMPT_PREFIX-}" ]; then + if [ -n "${BASH_VERSION-}" ] && [ "$PS1" = "\\s-\\v\\\$ " ]; then + PS1="[\u@\h \W]\\$ " + fi PS1="$SHELL_PROMPT_PREFIX$PS1" fi if [ -n "${SHELL_PROMPT_SUFFIX-}" ]; then + if [ -n "${BASH_VERSION-}" ] && [ "$PS1" = "\\s-\\v\\\$ " ]; then + PS1="[\u@\h \W]\\$ " + fi PS1="$PS1$SHELL_PROMPT_SUFFIX" fi