fix(tmux): restore saved sessions after a reboot ourselves, not via continuum #59
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!59
Loading…
Reference in a new issue
No description provided.
Delete branch "maximus/tmux-autorestore"
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
After the spl-vm05 restart on 2026-11-24, tmux came back with one empty window, and every Claude session had to be resumed by hand.
Root cause. The status-right autosave hook (
#(continuum_save.sh), hardcoded since10612a9) fires on the first status redraw of a new server. At that point continuum has not yet seeded@continuum-save-last-timestamp, so it saves the empty new server straight away (server start 18:06:02, save 18:06:03) and pointslastat that save. The restore then has nothing left to restore. Continuum's restore has a second weak spot: it skips whenever it counts more than one othertmuxprocess at startup, and oh-my-tmux's config commands are such processes.Change
@continuum-save-last-timestampfrom#{start_time}when the server starts. The first autosave then runs 15 minutes later, andlastkeeps the pre-reboot layout.@continuum-restore off. Instead, run the new~/.config/tmux/autorestore.shonce per server, on the default socket only, sotmux -Lortmux -Stest servers never restore your saves. The script waits until tmux-resurrect has loaded, then runs itsrestore.sh. Thetmux-claude-attention resurrect-restorehook (Claude panes resume) still fires.~/tmux_no_auto_restorestill turns the restore off, as it did with continuum.Test
Run on an isolated server: separate HOME, separate socket directory, all
TMUX*andXDG_*variables unset, and a client attached at once, as after a boot. The fake save held two sessions and three windows.lastoverwritten, nothing restored (reproduces the bug)lastuntouchedsourcereloadRollout: spl-vm05 and wyse-01 pick this up through dotfiles-pull. It takes effect at the next tmux server start.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XMf4EKe3p4ASJuA4DPKqVy