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 <petersen@redhat.com>
This commit is contained in:
Jens Petersen 2025-08-01 21:19:02 +08:00
parent 55582290eb
commit 59640cecd9
1 changed files with 4 additions and 2 deletions

View File

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