fix(tmux): autorestore only into a server without sessions #60
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/dotfiles-public!60
Loading…
Reference in a new issue
No description provided.
Delete branch "maximus/tmux-autorestore-fresh-only"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Follow-up to #59, found while checking its rollout. On a tmux server that is already running,
@autorestore_startedis still unset when the new config arrives. So the first config reload there (prefixr, or the plugin update on reload) would run the restore into the live server.tmux-claude-attention resurrect-restorewould then typeclaude --resume <id>into every pane inclaude-resume.tsvthat is a bare shell at that moment. That can mean duplicate Claude sessions or the wrong session in a reused window.Change
The restore gate now also requires
#{server_sessions} == 0. The config is loaded before the first session of a fresh server exists, and the server is never in that state again.Test
Isolated server, as for #59:
script -qfc "tmux new -s 0")set -gu @autorestore_started,sourcethe configOn spl-vm05's live server I set
@autorestore_started 1by hand as a guard until this lands. Servers on other hosts that are already running (wyse-01) need this PR before their next config reload.🤖 Generated with Claude Code
https://claude.ai/code/session_01XMf4EKe3p4ASJuA4DPKqVy