From 59640cecd9c9bab215583f91bc614e6d5f5973bf Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 1 Aug 2025 21:19:02 +0800 Subject: [PATCH] toolbox.sh: respect new TOOLBOX_DO_NOT_OVERRIDE_PS1 This allows users to set `TOOLBOX_DO_NOT_OVERRIDE_PS1` in their shell configuration to prevent toolbox from overriding PS1. Addresses #1357 Signed-off-by: Jens Petersen --- profile.d/toolbox.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/profile.d/toolbox.sh b/profile.d/toolbox.sh index c2f9fa0e0..195151bdb 100644 --- a/profile.d/toolbox.sh +++ b/profile.d/toolbox.sh @@ -48,8 +48,10 @@ 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 [ "${TOOLBOX_DO_NOT_OVERRIDE_PS1}" = "" ]; then + [ "${BASH_VERSION:-}" != "" ] && PS1=$(printf "\[\033[35m\]⬢ \[\033[0m\]%s" "[\u@\h \W]\\$ ") + [ "${ZSH_VERSION:-}" != "" ] && PS1=$(printf "\033[35m⬢ \033[0m%s" "[%n@%m]%~%# ") + fi if ! [ -f "$toolbox_welcome_stub" ]; then echo ""