switch tmux to individual sessions

This commit is contained in:
daniel fusser
2026-07-08 22:23:02 +02:00
parent b4b2ac91c2
commit e65c3331b4
2 changed files with 11 additions and 3 deletions
+5 -3
View File
@@ -216,10 +216,12 @@ PS4='[$EPOCHREALTIME] '; PS1='#'; (( USER_ID )) && PS1='→'; PS1=$'\001\r''${|
\\builtin return $e
} '"${hostcol}${bld}$PS1 ${rst}"
# tmux auto-attach: one shared session per host. No -exec, so if tmux is
# missing or exits/crashes for any reason, this shell just continues normally.
# tmux auto-attach: bare invocation so tmux.conf's default-client-command
# grants each connection its own session grouped with "main" (shared panes,
# independent window navigation). No -exec, so if tmux is missing or
# exits/crashes for any reason, this shell just continues normally.
tmuxbin=$(\\builtin whence -p tmux 2>/dev/null)
if [[ $- = *i* ]] && [[ -t 0 ]] && [[ -z $TMUX ]] && [[ -n $tmuxbin ]]; then
"$tmuxbin" new-session -A -s "${HOSTNAME:-main}"
"$tmuxbin"
fi
unset tmuxbin