From 3c176953ad7a17ef2490ae650aa7ae6b072ffe43 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Sun, 7 Jul 2024 14:54:18 +0800 Subject: [PATCH] profile.d: prepend purple hexagon to PS1 rather than overwriting it Importantly this means the traditional Red Hat style prompt is not forced onto all other OS toolboxes too. A space is added after the hexagon since vte tends to render it too big at least with google-noto-color-emoji-fonts. https://github.com/containers/toolbox/pull/1517 Signed-off-by: Jens Petersen --- profile.d/toolbox.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/profile.d/toolbox.sh b/profile.d/toolbox.sh index d2e16cbd7..f4023eb0e 100644 --- a/profile.d/toolbox.sh +++ b/profile.d/toolbox.sh @@ -48,8 +48,8 @@ fi if [ -f /run/.containerenv ] \ && [ -f /run/.toolboxenv ]; then - [ "${BASH_VERSION:-}" != "" ] && PS1=$(printf "\[\033[35m\]⬢\[\033[0m\]%s" "[\u@\h \W]\\$ ") - [ "${ZSH_VERSION:-}" != "" ] && PS1=$(printf "\033[35m⬢\033[0m%s" "[%n@%m]%~%# ") + [ -n "${BASH_VERSION}" ] && PS1="\[\e[35m\]⬢\[\e[0m\] $PS1" + [ -n "${ZSH_VERSION:-}" ] && PS1=$(printf "\033[35m⬢\033[0m %s" "$PS1") if ! [ -f "$toolbox_welcome_stub" ]; then echo ""