From 833d03c41603cfc0a3a304da99394c6d55039f89 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 16 May 2025 17:49:58 -0700 Subject: [PATCH] Add a visual bell to highlight tmux tabs upon command completion --- .bashrc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index d078e85..64fe8a8 100644 --- a/.bashrc +++ b/.bashrc @@ -82,7 +82,7 @@ if [ "$color_prompt" = yes ]; then context_color=$red prompt_symbol=💀 fi - PROMPT_COMMAND='if [[ $? != 0 && $? != 130 ]];then echo "⚠️";fi' + PROMPT_COMMAND='if [[ $? != 0 && $? != 130 ]];then echo -e "⚠️\a";else echo -e "\a";fi' PS1="$chrome_color┌──"'${debian_chroot:+('${path_color}'$debian_chroot'${chrome_color}')─}${VIRTUAL_ENV:+('${path_color}'$(realpath $VIRTUAL_ENV --relative-to $PWD --relative-base /home)'${chrome_color}')─}'"[${context_color}\u${chrome_color}${prompt_symbol}${context_color}\h${chrome_color}]─(${path_color}\w${chrome_color})\n${chrome_color}└${context_color}${prompt}${color_off} " PS2="$chrome_color└>$color_off " @@ -150,8 +150,8 @@ fi # Customizations -# Use tmux for local shells -if [ -z "${SSH_CONNECTION}" ] && [ -z "${TERM_PROGRAM}" ]; then +# Use tmux for local unelevated shells +if [ -z "${SUDO_USER}" ] && [ -z "${SSH_CONNECTION}" ] && [ -z "${TERM_PROGRAM}" ]; then tmux new -A -s local_tmux fi @@ -179,3 +179,7 @@ PROMPT_COMMAND="${PROMPT_COMMAND};history -a" # Cargo binary path [ -d "${HOME}/.cargo/bin" ] && export PATH="${PATH}:${HOME}/.cargo/bin" + +# Funciton to notify after a long-running command +alias bell="echo -e '\a'" +