From 0df21404d20130d276f796229a8243300cf84720 Mon Sep 17 00:00:00 2001 From: John Mertz Date: Thu, 21 Jul 2022 01:52:50 -0400 Subject: [PATCH] Force change to dynamic title Uses the last word of the last command run. That provides some small amount of insight. It seem to be the easiest available way to differentiate terminals, for example using wofi-alt-tab.sh --- bash/bashrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bash/bashrc b/bash/bashrc index 11c9dd5a8..318c88860 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -44,10 +44,12 @@ if ! shopt -oq posix; then fi fi -# Bell when prompt is returned to mark as urgent -PROMPT_COMMAND='printf "\a"; history -a' +# Set window title to last command +PROMPT_COMMAND='echo -e -n "\033]2;$_\007"' # Reconfigure prompt after each return PROMPT_COMMAND="$PROMPT_COMMAND; source ${HOME}/.dotfiles/bash/prompt.sh" +# Bell when prompt is returned to mark as urgent +PROMPT_COMMAND="$PROMPT_COMMAND;printf \"\a\"; history -a" # Enable color support if possible if [ -x /usr/bin/dircolors ]; then @@ -102,3 +104,6 @@ export XDG_DATA_DIRS="$XDG_DATA_DIRS:${HOME}/.config/flatpak/exports/share" export SWAYSOCK=`sway --get-socketpath` export CHROME_EXECUTABLE="/usr/bin/chromium" export FLATPAK_IDE_LOG_LEVEL="0" + +# Set initial title +echo -e -n "\033]2;Welcome to Bash\007"