From a1b1f0a3df9321c34338b9553a923128b0a172e5 Mon Sep 17 00:00:00 2001 From: Doncho Gunchev Date: Sun, 11 Oct 2020 14:25:38 +0300 Subject: [PATCH] Preserve PROMPT_COMMAND if set, name this z-smth in profile.d vte.sh from vte291 coexistence See https://bugzilla.redhat.com/show_bug.cgi?id=1183192 In oreder work this script should be sourced after vte.sh, so the name should be something that sorts after vte.sh (z-ps-twtty-7.sh) --- bash/ps-twtty-7.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bash/ps-twtty-7.sh b/bash/ps-twtty-7.sh index e725bb0..ccaba07 100755 --- a/bash/ps-twtty-7.sh +++ b/bash/ps-twtty-7.sh @@ -134,7 +134,7 @@ function twtty { ;; esac - PS1="$TITLEBAR\ + export PS1="$TITLEBAR\ ${C1}┌${C2}─(\ ${C1}\${my_D}${C2}, ${C1}Err ${C3}\$?${C2}, ${C3}\${my_TTY}\ ${C2})─${C1}─\${my_FILL}${C2}─(\ @@ -145,8 +145,12 @@ ${C1}└${C2}─(\ ${C1}\${USER}${C2}@${C1}\${HOSTNAME%%.*}\ ${C2})${C3}\$${NO_COLOUR} " - PS2="${C2}─${C1}─${C1}─${NO_COLOUR} \[\033[K\]" - PROMPT_COMMAND=prompt_command + export PS2="${C2}─${C1}─${C1}─${NO_COLOUR} \[\033[K\]" + if [ -z "${PROMPT_COMMAND}" ]; then + export PROMPT_COMMAND=prompt_command + else + export PROMPT_COMMAND="${PROMPT_COMMAND}; prompt_command" + fi trap prompt_command_exit EXIT shopt -s cmdhist histappend export HISTCONTROL='ignorespace:erasedups'