Repository navigation
Conversation
Full snapshots omit disabled input modes. Clear inherited mouse protocols, encodings and focus reporting before replay, then let a live TUI re-arm its own modes. Cover daemon reattach, paired reconnect and hidden restore. Fixes #18424. Thanks to @bjornrun (#20087), @innocarpe (#18454), and @Jinwoo-H (#22735) for the earlier diagnosis, proposals, and daemon recovery work.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
ELI5
After a server restart, moving the mouse could type
35;…;…Minto a restored shell. The client now clears the previous program’s mouse and focus settings before reading the server’s full terminal snapshot. A still-running TUI gets its settings back from that snapshot.What Changed
Serialized snapshots describe enabled modes and omit defaults. A mounted client could therefore retain mouse/focus reporting from a dead TUI even when the replacement shell’s snapshot was clean. A persisted agent title then selected an epilogue that preserved those inherited modes.
Reset mouse protocols and focus reporting before authoritative snapshot replay. Preserve the encoding when an older host omits it; explicit encoding bytes in a snapshot still apply. Reuse one reset in the shared replay prologue and the daemon-reattach snapshot path, covering paired reconnects and hidden-pane restores. Preserve existing post-replay policy and partial live-stream replay.
Why
The snapshot’s actual mode bytes become authoritative. Clearing modes after replay would break a surviving TUI; removing mouse enables from checkpoints would not clear modes already active in a mounted client. This approach also works with 1.4.229 servers that omit ownership metadata and changes no wire format.
Linked Issue
Fixes #18424
Credit to @bjornrun for the open proposal in #20087 and @innocarpe for the diagnosis and earlier proposal in #18454. This completes the client-side snapshot handling alongside @Jinwoo-H’s daemon recovery fix in #22735.
Visual Proof
Both captures use an official Linux 1.4.229 server with a macOS client. The after capture uses the initial fix build; final-source validation is listed below. A controlled TUI enabled mouse/focus reporting, was killed, and the server/daemon restarted while the client stayed mounted. Moving the pointer produces shell garbage before the fix and zero reports afterward. The after capture is taken before running
resetor reloading.Before:
After:
Surviving TUI after app reattach (wheel and drag behavior asserted):
Testing
Reproduce locally after an E2E build:
AI Disclosure
Review
Claude Opus 5.5 reviewed this through Orca orchestration in two rounds. Final commit
f0127939baf9dbbf72b2feea9b38b11e48f81cb0is CLEAN: all four initial findings resolved, with no outstanding actionable regression. The review covered full versus partial replay, live TUI mode restoration, older-host encoding compatibility, cleanup, and the proof claims.The reviewer also noted a pre-existing default-encoding gap when a main-model restore skips a too-wide alternate frame. This PR preserves that existing behavior.
Agent skill upstream boundary
Notes
Production change is platform-independent and runs in the renderer; no subprocesses, process probes, polling, or wire changes added. Tested on macOS with local and Ubuntu 24.04 paired hosts, including a non-git folder workspace. Windows was not executed. Linux captures precede the older-host encoding refinement; the final build was rechecked with the local cold-restart and live-TUI controls above. The externally provisioned release proof uses a protocol-controlled TUI and a source-built macOS client, not a packaged macOS client or a real Claude session. Test apps remained hidden. Owned remote fixtures were stopped after validation.
Checklist