From 11202d06d9e45d1cf99311632f8ff5f4ff44f260 Mon Sep 17 00:00:00 2001 From: gibbyb Date: Tue, 2 Jun 2026 08:22:22 -0500 Subject: [PATCH] Add an automatic tmux session when using ssh --- config/bash/shell | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/bash/shell b/config/bash/shell index 928eb6e..2e81960 100644 --- a/config/bash/shell +++ b/config/bash/shell @@ -21,7 +21,6 @@ export PATH="$HOME/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin: # Nvm source /etc/profile.d/nvm.sh - # Auto-switch Node version when entering a directory with .nvmrc _nvm_auto_use() { if [[ -f .nvmrc ]]; then @@ -30,6 +29,11 @@ _nvm_auto_use() { } export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }_nvm_auto_use" +# Auto-start or attach tmux for SSH interactive shells +if [[ -n "$SSH_CONNECTION" && -z "$TMUX" && $- == *i* ]]; then + exec tmux new-session -A -s main +fi + # Zoxide eval "$(zoxide init bash)"