From 223fd86d87c7bf10a9d9dc90f5db6b34f4b6e160 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 This also avoids the need to have separate definitions for bash and zsh More importantly it means the traditional Red Hat style bash prompt is not forced onto all other OS toolboxes too. https://github.com/containers/toolbox/pull/1517 Signed-off-by: Jens Petersen --- profile.d/toolbox.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/profile.d/toolbox.sh b/profile.d/toolbox.sh index d2e16cbd7..1a2ea12ba 100644 --- a/profile.d/toolbox.sh +++ b/profile.d/toolbox.sh @@ -48,9 +48,9 @@ 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]%~%# ") - + if [ -n "${BASH_VERSION:-}" ] || [ -n "${ZSH_VERSION:-}" ]; then + PS1="\[\e[35m\]⬢ \[\e[0m\]$PS1" + fi if ! [ -f "$toolbox_welcome_stub" ]; then echo "" echo "Welcome to the Toolbx; a container where you can install and run"