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.
This commit is contained in:
Yu Watanabe
2025-08-06 14:49:43 +09:00
committed by Luca Boccassi
parent ea2beb6591
commit 0dc0bf4caf

View File

@@ -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