From 0dc0bf4caf267c49be3d574ba9d10a43bebc7465 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 6 Aug 2025 14:49:43 +0900 Subject: [PATCH] profile: replace default bash prompt with more informative one MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- profile.d/70-systemd-shell-extra.sh | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.47.3