From 5389a1e4842b9a7e79598ef666888f93fd536c94 Mon Sep 17 00:00:00 2001 From: John Mertz Date: Wed, 31 Jan 2024 22:31:31 -0700 Subject: [PATCH] Push window title until later to have more details --- bash/bashrc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bash/bashrc b/bash/bashrc index 21a7e8860..04d6b503f 100644 --- a/bash/bashrc +++ b/bash/bashrc @@ -34,20 +34,12 @@ if [[ -z $TERM_TITLE ]]; then TERM_TITLE="$TERM"; fi -PS0='\[\e]0;$(last_command) - $TERM_TITLE\a\]' -# Update prompt -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" # Load aliases if [ -f ${HOME}/.dotfiles/bash/bash_aliases ]; then . "${HOME}/.dotfiles/bash/bash_aliases" fi - -# Set initial title -echo -e -n "\033]2;Welcome to Bash\007" # Perl eval "$(plenv init -)" source ${HOME}/.dotfiles/bash/plenv-path.sh @@ -63,6 +55,15 @@ source ~/perl5/perlbrew/etc/bashrc . "$HOME/.cargo/env" # Hide errors clear +# Set window title to last command +PS0='\[\e]0;$(last_command) - $TERM_TITLE\a\]' + +# Update prompt +PROMPT_COMMAND="source ${HOME}/.dotfiles/bash/prompt.sh" +# Bell when prompt is returned to mark as urgent +PROMPT_COMMAND="$PROMPT_COMMAND;printf \"\a\"" +# Append previous command to history immediately +PROMPT_COMMAND="$PROMPT_COMMAND;history -a" if [[ -n "$(which fastfetch 2> /dev/null)" ]]; then if [ -n $DISTROBOX ] && [ -e ${HOME}/.dotfiles/fastfetch/${DISTROBOX}.jsonc ]; then fastfetch -C ${HOME}/.dotfiles/fastfetch/${DISTROBOX}.jsonc