Resurrect not restoring anything
I can not get the resurrect plugin to work.
I start a new tmux session, create a couple of tmux tabs and change the context and name.
- Start tmux, create a random session
- start a terminal (pwsh)
tmuxcd ..PREFIX + ,pane1PREFIX + cPREFIX + ,pane2PREFIX + ccd <tab>PREFIX + ,pane3
- Save the session
PREFIX -> ctrl+s
- Quit the terminal
- Start tmux, create a random session
- start a terminal (pwsh)
tmux
- Restore the session
PREFIX -> ctrl + r
The restore starts doing things, but I get a brief message saying
psmux-resurrect: restored 0/28, skipped 28 (already running)
And then a huge popup saying that Session 'N' already exists, skipping
What are all these sessions it is trying to restore? Isn't there only like 3 at most?
How can I debug this?
The huge amount of sessions is due to this https://github.com/psmux/psmux/issues/585
Hey @Jerakin, thanks for the careful step list, and for the follow up pointing at psmux/psmux#585. That link is the whole story, so let me spell it out and then show what changed.
What actually happened
Closing the terminal window does not stop psmux. The client detaches and the server, with every session in it, keeps running. That is by design and it is the same as tmux. So in your steps:
- bare
tmuxcreated session0, you builtpane1,pane2,pane3in it and saved - you closed the window: session
0stayed alive on the server - the next bare
tmuxdid not reuse it, it created session1beside it - every save persisted all of them, and every restore found all of them still running and skipped them
Repeat that over a few days and you get the 28 sessions you saw. Nothing was lost; your pane1 to pane3 windows were sitting in session 0 the whole time. tmux ls shows them and tmux attach -t 0 takes you back. Resurrect earns its keep after a reboot or a tmux kill-server, when the sessions really are gone.
Where the plugin failed you was the report: 28 lines of Session 'N' already exists, skipping in a popup, and a toast that only said restored 0/28, with no hint that "already running" meant "go attach to them".
What changed (pushed to main today)
- restore output is now short and readable in the popup: a header naming the save file, one line per restored session, one collapsed line for everything that was left alone (
Still running, left alone: 0, 1, 2, ... and 20 more) with the two ways forward (psmux attach -t <name>, or@resurrect-overwrite 'on'to recreate from the save), and the summary line. When nothing came back because everything was still running the summary now says exactly that and points atpsmux ls. (5fd9220) - untouched numbered sessions (one window, one pane, idle shell, the shape every stray bare launch leaves behind) are no longer written into the save at all, so the pile stops growing on disk. A numbered session you have actually built windows in, like your
0, is still saved. That is@resurrect-save-unnamedfrom #37. (01c03ab) - the README has a troubleshooting section for exactly this: what "still running" means, how to inspect what a save contains, and how to run the save or restore script directly from a terminal to see the same report the popup shows.
Debugging it yourself
Two commands answer most questions:
psmux ls
pwsh -NoProfile -File "$env:USERPROFILE\.psmux\plugins\psmux-resurrect\scripts\restore.ps1"
The first shows what is actually running, the second prints the restore report in your terminal instead of a popup, including which save file it used.
To clean up the sessions you already have: psmux kill-server, then restore, or psmux kill-session -t <n> for the ones you do not want. Prefix + U in ppm pulls the plugin update. If the restore still does nothing after the sessions are really gone, please paste the report and I will look again.