diff --git a/.bashrc b/.bashrc index 59ba312..ed78568 100644 --- a/.bashrc +++ b/.bashrc @@ -8,6 +8,11 @@ case $- in *) return;; esac +# Auto-launch tmux on SSH connection +if [[ -n "$SSH_CONNECTION" ]] && [[ -z "$TMUX" ]] && command -v tmux &> /dev/null; then + tmux attach-session -t default || tmux new-session -s default +fi + # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth