Expand description
Putting a claude session back on the version that is installed now.
The part where a mistake costs a turn of work rather than a redraw. Everything here is built around one rule: a pane it cannot be sure about is skipped, with a reason. Guessing which conversation a pane is on and then interrupting it is worse than doing nothing.
The guards, in the order they are applied, and what each is for:
- Not this pane. Restarting the pane taimux is running in would kill taimux mid-restart.
- Only a stale version. A pane already on the installed version has nothing to gain from being interrupted.
- Idle, unless
--include-busy. A turn in flight is work in progress. - A conversation that could be identified, from the ladder in
conv. - No dialog on screen, ever, even with
--include-busy: a half-answered permission prompt is the one state where a Ctrl-C means something else. - No unsent draft, and a settled transcript, unless
--include-busy. - No transcript claimed twice. Resuming one conversation into two panes is the same mistake on a restart as on a restore.
Structs§
Traits§
- Env
- Everything the plan needs from the outside, so it can be built against fixtures as well as against a live machine.
Functions§
- capture_
zoomed - One pane’s screen, read at a size claude will draw its prompt box on.
- confirm_
yes - The default answer is yes, so a bare Enter restarts. The plan has already been printed by then, which is what makes that safe.
- describe_
nonpane - What to say about a claude that has no pane.
- installed
- What a session started right now would run, refusing rather than guessing when the launcher points somewhere unexpected.
- launcher
- nonpane_
pids - A claude process that is not any pane’s foreground job: Zed’s ACP bridge, a background agent, one of the daemon’s spare pty hosts.
- plan
- Decide what to restart, and say why for everything else.
- render
- The plan, as the reader sees it. Byte-for-byte what bash printed, because the only way to know a port of this is right is to compare it.
- restart_
pane - Interrupt a session, wait for it to go, and type its replacement.
- screen_
has_ no_ dialog - Is the screen free of anything a Ctrl-C would mean something else to?
- screen_
has_ no_ draft - Is the prompt box empty?
- transcript_
is_ settled - Is this transcript quiet enough to interrupt?
- version_
of_ pid - The version a running process is executing, read from its own
/proc/exerather than from the binary on$PATH: a long-lived session goes on running the release it started under. - versions_
dir