# set a fancy prompt (non-color, unless we know we "want" color) case "$TERM" in xterm-color|*-256color|screen*|tmux*) color_prompt=yes;; esac # Local desktop tmux wrapper (No-Exit Edition) if [[ -z "$TMUX" && -z "$SSH_CONNECTION" && -n "$DISPLAY" && $- == *i* && -z "$BASH_EXECUTION_STRING" ]]; then # Unique session name SESSION_NAME="term_$(date +%s)_$$" # Run tmux cleanly. When you close or detach from SSH, # this local terminal will just sit silently instead of closing. tmux new-session -A -s "$SESSION_NAME" \; set-option remain-on-exit on # Fallback safety: If tmux completely exits, keep the window open echo "Tmux session ended. Press Enter to drop to regular shell..." read fi