命令:cat >> ~/.bashrc <<'EOF'

SSH 登录后自动回到 tmux

case $- in

i)

if [ -z "$TMUX" ] && command -v tmux >/dev/null 2>&1; then

tmux attach -t main 2>/dev/null || tmux new -s main

fi

;;

esac

EOF