Repository navigation
fix(terminal): ground a program that dies with input modes armed on the normal screen - #22739
Conversation
A durable checkpoint was folded from the previous checkpoint plus recorded output, so it inherited that checkpoint's modes forever. After a daemon restart killed a full-screen TUI and a new process started inline, the chain kept the dead TUI's alt screen and mouse tracking (?1049h ?1003h ?1006h) while the live emulator was clean. Every reattach and getBufferSnapshot served the stale chain, the renderer re-armed mouse tracking, and wheel scrolling went to a program that never asked for it: scrolling froze. Each full checkpoint is now the live snapshot verbatim (screen, layout, alt frame, modes, owner) with only the normal-buffer rows live has evicted taken from the durable replay. A checkpoint can no longer carry a dead process's modes, and checkpoints already poisoned on disk heal on the next compaction. - The first fold after a cold restore replays the same seed segments live was given, so rows line up even over a dead TUI's alt screen. - Idle zero-record folds keep the disk copy when it already agrees with live, so quit and relaunch bursts don't replay every session. - Held teardown bytes are already in the drained records and the live snapshot, so they are no longer replayed twice or appended as a tail. - The bounded getBufferSnapshot path honors the requested depth even when the live window is deeper, without phantom link rows. - The fold's ownership scanner and frame merge are removed; owner and frame come from live.
…boundary Three copies of the "the process that armed these modes is gone" reset had drifted: the cold-restore seed cleared only pen and mouse, the recovery barrier used the renderer's dead-TUI profile, and the cold-restore payload had none. A cold restore therefore left the dead process's focus reporting, bracketed paste, application cursor and keypad modes armed in the live emulator, the first checkpoint, and main's mirror. And the seed wrote the dead process's torn escape after the reset, so the new shell's first bytes could complete it (for example retitling the pane). PROCESS_BOUNDARY_GROUND replaces them: CAN, leave the alt screen without moving the normal-buffer cursor, every mouse protocol and encoding off, focus/paste/app-cursor/keypad off, cursor shown and style reset, kitty popped, SGR reset, grounded DECSC. It stays inert for the lifecycle scanner. The seed, the recovery barrier, and the cold-restore payload all use it, and the seed no longer carries the torn tail. The first fold after a cold restore now always rebases on live, because focus and keypad are not in TerminalModes and the zero-record shortcut could not see them differ.
…he normal screen The daemon's in-stream crash detector only fired when a program died with the alternate screen up. A normal-buffer program that armed mouse tracking, focus reporting, keypad or kitty keyboard flags and exited without disabling them was cleaned up only in the renderer, so the daemon kept the modes and re-armed them on the next reattach, mobile included (#13077's garbage-at-the-prompt family). The lifecycle scanner now tracks armed input modes (mouse protocols and encodings, ?1004, ?66, and kitty flags as per-screen stacks that mirror xterm's main/alt swap and its 16-entry cap). ?2004 and ?1 are excluded: shells arm them at their own prompts. Modes armed when a command starts (OSC 133;C) count as the shell's, so a prompt that leaves modes on never triggers. At OSC 133;D the trigger is now "alt screen or a program-armed input mode", still one-shot and still gated by the shell proof, and the existing PROCESS_BOUNDARY_GROUND is recorded through the stream so live and durable history change together. WSL panes spawn wsl.exe, which the shell proof does not recognise, so the detector never grounds them; a test pins that and the renderer keeps covering them. The mouse-leak e2e now keeps its arming process alive until the live pane is checked, because the daemon grounds a proven exit.
There was a problem hiding this comment.
ℹ️ No critical issues — the model matches xterm's kitty semantics and the new tests are meaningful. Two informational notes and one suggestion on the e2e's coverage.
Reviewed changes
- New
TerminalArmedInputModesmodel (src/main/daemon/terminal-armed-input-modes.ts): tracks the armed private modes (9, 1000, 1002, 1003, 1004, 1005, 1006, 1015, 1016, 66) plus per-screen kitty keyboard flags and stacks (capped at 16), with shell ownership captured atOSC 133;C.?2004/?1are excluded because shells arm them at their own prompts. - Scanner trigger widened (
src/main/daemon/terminal-shell-lifecycle-scanner.ts):uncleanDeathnow fires atOSC 133;Dwhen the alt screen is up or a program-armed tracked mode survives, and the kitty regex / scan-tail matcher now includeCSI < n u(pop) which feeds the model. RIS resets the model too. - Tests: new
terminal-shell-armed-input-mode-recovery.test.ts(scanner arming + one-shot + Session-level ground recording/refutation), a WSL shell-proof pin, and the existing reattach e2e whose precondition now keeps the arming process alive.
I verified the model against @xterm/xterm's KittyKeyboard (push/pop/set modes, 16-entry eviction) and InputHandler (?47/?1047/?1049 flag swap) — the screen-key deletion is correctly evaluated before onAlternateScreen flips, so switchScreen removes the source screen's key. All 40 scanner/armed-mode tests and the 2 WSL pin tests pass locally.
ℹ️ Windows: ?1004 provenance is still unresolved
The POSIX tests can't cover the one Windows item in the Notes. Because 1004 is tracked and only becomes shell-owned if it is armed before an OSC 133;C, the outcome hinges on whether ConPTY / PSReadLine arms focus reporting at the command start (after C) or at the prompt. If it is the former, every Windows command would trip the trigger and pay the proof pause plus a ground.
Technical details
# Windows ?1004 provenance
## Affected sites
- `src/main/daemon/terminal-armed-input-modes.ts:4` — `1004` is in `TRACKED_PRIVATE_MODES`.
- `src/main/daemon/terminal-shell-lifecycle-scanner.ts:131` — trigger when `inputModes.hasProgramArmedModes`.
## Required outcome
- Confirm that on Windows the shell (not the PTY/ConPTY layer, after `OSC 133;C`) arms `?1004`, so a plain command does not trip the trigger. The author's Notes list this as open ("Whether ConPTY arms `?1004h` at session start").
## Open questions for the human
- If ConPTY arms `?1004h` per command, should `1004` be excluded from `TRACKED_PRIVATE_MODES` (or shell-owned on Windows) the way `?2004`/`?1` are?ℹ️ The ground clears only the on-screen kitty stack
PROCESS_BOUNDARY_GROUND emits ?1049l before CSI <99u / CSI =0u. ?1049l parks the dying TUI's flags into altFlags and leaves altStack untouched, so the pop/set run against the normal buffer's stack and only zero flags. The new model mirrors this faithfully (switchScreen carries altFlags), but the new "the ground can always clear it" test only exercises the main stack — a dead alt-screen TUI's off-screen kitty state survives and is restored by the next ?1049h.
Technical details
# Off-screen kitty state survives the ground
## Affected sites
- `src/shared/terminal-mode-reset-profiles.ts:50,63` — `?1049l` precedes `RESET_KITTY_KEYBOARD_PROTOCOL` (`\x1b[<99u\x1b[=0u`).
- `src/main/daemon/terminal-armed-input-modes.ts:56-58` — model carries `kittyAltFlags` across the swap.
- `src/main/daemon/terminal-shell-armed-input-mode-recovery.test.ts:90` — "bounds the kitty stack so the ground can always clear it" (main stack only).
## Required outcome
- Decide whether the ground should also reset the inactive screen's kitty flags/stack. xterm restores `altFlags` on the next `?1049h`, so an alt-screen TUI that does not negotiate kitty can inherit the dead TUI's flags.
## Open questions for the human
- Is this in scope for the stacked branch, or a known limitation of the #22735 ground? The root cause (`RESET_KITTY_KEYBOARD_PROTOCOL`) predates this PR; it is called out because the new model and test now depend on the property.DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…cess-boundary ground ConPTY arms focus reporting (?1004h) before the first prompt, and the live recovery ground cleared it for the rest of the pane. The barrier now re-arms the modes that were on at OSC 133;C right after the ground, so only the dead program's modes are reset.
… command A mode a program leaked past a refuted proof was still on at the next OSC 133;C, so the baseline snapshot re-armed it after a later ground. Record who armed each mode instead: only enables outside a command (before any marker, or between 133;A/D and C) form the baseline.
There was a problem hiding this comment.
Important
A redundant re-enable of an already-armed host mode revokes its host ownership, so a later ground clears it and never restores it.
Reviewed changes
Since the prior review at 4349d4b, the delta extends the armed-input-mode model so shell- and host-armed modes survive the process-boundary ground.
- Host/shell ownership tracking (
src/main/daemon/terminal-armed-input-modes.ts): ahostArmedset plus aninCommandflag capture modes enabled outside a command (ConPTY's?1004h, shell prompt modes), andmarkCommandStartrecords a per-commandbaselinePrivateModes/baselineKittyFlagsatOSC 133;C.markPromptBoundaryclearsinCommandon133;A/D. - Ground re-assertion (
src/main/daemon/terminal-shell-recovery-barrier.ts:286-289): the confirmed ground now releasesPROCESS_BOUNDARY_GROUNDfollowed byscanner.reassertCommandBaseline(), re-arming only the modes that were host/shell-owned atC. - Scanner wiring (
src/main/daemon/terminal-shell-lifecycle-scanner.ts:81-84,131-133):reassertCommandBaseline()delegates to the model, and133;A/Dmark the prompt boundary. - Tests: new scanner baseline-reassert case, two Session cases (ConPTY
?1004hsurvives the ground; a mode leaked past a refuted proof is cleared and not re-asserted), and the reattach e2e / its header reworded for the in-stream ground.
I verified the new ownership transfer path against @xterm/xterm's kitty screen-swap semantics; the barrier's ground scan still contains no enables or OSC 133, so the re-assert cannot re-open the one-shot trigger. One issue inline.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…t folds and trims Stop seeding persisted OSC link ranges into the fold replay: they index the base buffer, so rows evicted by pending output left a link on the wrong text. The serializer already writes OSC 8 into the ANSI the fold replays. Re-apply kitty keyboard flags when replaying a snapshot for trimming, since rehydrateSequences omits them. Bound a smaller restore request by trimming the committed checkpoint instead of re-reading disk and rebasing the live window at a smaller depth.
# Conflicts: # src/main/daemon/daemon-durable-history-snapshot.ts
…ble fold The live window's override cap now derives from the restore depth, so live can never be deeper than the fold. pendingRecords and isFirstTake are required.
# Conflicts: # src/main/daemon/daemon-durable-history-snapshot.ts
…round Kitty keyboard stacks are per screen, so resetting only after ?1049l left a dead TUI's alt-screen flags for the next alt-screen app. Also drop the inert CAN from the ground (every site grounds after complete bytes) and correct two stale comments.
Each armed mode now has one owner: host (before any marker, or a prompt a 133;C proved), prompt (unproven until C), command, or stale (left past a D). Host arming is sticky, 133;D demotes command modes (the one-shot), and the ground re-asserts only host modes. Fixes a D without C triggering on host modes, an ESC c mid-command turning later enables into host modes, and a program's repeated host enable dropping host ownership. The reattach e2e now keeps the arming program alive so only the reattach reset can disarm it.
fish, the one shell that pushes kitty flags at its prompt, pops them before running a command and re-pushes at the next prompt, so the ground never needs to restore them. Only host private modes are re-asserted now.
…l-freeze-detector
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior review at 7effeb0, the only feature delta is ed3bc18; the three commits before it are base-merges that changed none of the PR's files.
- Single ownership map (
src/main/daemon/terminal-armed-input-modes.ts): replaced thearmed/shellOwned/hostArmed/inCommandfields with oneMap<ModeKey, ModeOwner>(host/prompt/command/stale), anenableOwner, andhostKittyFlags. - Ownership transitions:
133;Cpromotespromptkeys tohost;133;Ddemotescommand/promptkeys tostaleand reports whether acommand-owned mode survived; a re-enable of an already-host-owned mode is now a no-op. - Ground path (
terminal-shell-lifecycle-scanner.ts:85,terminal-shell-recovery-barrier.ts:284):groundProcessBoundary()captureshostModes()before scanning the reset, then re-asserts and re-claims them as the host's. - Tests: new Session cases for the redundant host re-enable and the mid-command
ESC cownership, scanner cases for prompt→host promotion, and the process-boundary fixture gained a leading133;A.
Both prior Pullfrog threads are addressed by this commit and have been resolved. I re-ran the three touched suites (30 tests, all pass) and traced the host-stickiness fix, the no-133;C path, and the kitty screen-swap/ground interactions; the refactor preserves the ConPTY focus-survival and clean-alt-exit behavior.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No critical issues — two minor suggestions inline, both about the fish assumption the re-assertion removal rests on.
Reviewed changes
Since the prior review at ed3bc18, the delta is d594a6561b (plus a base-merge that changed no feature files):
- Dropped host kitty-flag tracking (
src/main/daemon/terminal-armed-input-modes.ts):hostKittyFlagsand theclaim/disarmhelpers are gone;hostPrivateModes()reports only host-owned numeric modes, andreassertHostModes()emits only those bytes (noCSI > flags u). - Ground no longer re-asserts kitty flags (
terminal-shell-lifecycle-scanner.ts:85-89); scanningPROCESS_BOUNDARY_GROUNDis what zeroes them. - Test: the reassert case now expects
${PROCESS_BOUNDARY_GROUND}\x1b[?1004honly.
I verified the removal is safe for the shell it names: upstream fish clears the kitty keyboard protocol (CSI = 0 u) before every command and re-sets it (CSI = 5 u) at each prompt, so the next prompt repairs a ground. Two minor notes inline about the comment wording and the synthetic fixture not matching that real sequence.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
# Conflicts: # src/main/daemon/process-boundary-ground.test.ts # src/main/daemon/terminal-shell-recovery-barrier.ts
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe change tracks ownership of selected private terminal modes and Kitty keyboard flags. The lifecycle scanner uses that state to detect unclean command endings and build process-boundary resets that preserve host-owned focus reporting. The recovery barrier releases the scanner-generated reset. Tests cover scanner and session recovery, Windows WSL foreground proof, and mouse-mode behavior during terminal reattach. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The previously identified recovery failure is prevented by the current ownership rules. No identified issue remains to block merging after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The reviewed recovery path adds a foreground-shell check before resetting terminal modes and preserves focus reporting owned by the host. No new security issue was established, but platform behavior and review coverage are not complete. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ConPTY answers a mid-command ESC c by re-sending ?1004h, which reset() had recorded as the command's, so the ground turned host focus reporting off for the rest of the pane. RIS now drops only non-host ownership.
There was a problem hiding this comment.
ℹ️ No new issues in the delta —
7e57944is a correct, focused fix. Two prior minor suggestions (the fish comment wording and the synthetic fixture) remain open, so this review does not approve.
Reviewed changes
Since the prior pullfrog review at b3741f1 (5f58ff4 was a zero-delta base-merge), the only feature delta is 7e57944:
- Host ownership survives a full reset (
src/main/daemon/terminal-armed-input-modes.ts:133-146):reset()no longer callsowners.clear(). It drops every non-hostowner plus all kitty flags/stacks andonAlternateScreen, but retains host-owned numeric modes. ConPTY answersESC cby re-sending?1004h ?9001h; under the old clear, that re-enable would be attributed toenableOwner='command', so the next133;Dground would clear focus reporting and re-assert nothing. The retained host key makes the re-enable a sticky-host no-op. - New Session test (
src/main/daemon/terminal-shell-armed-input-mode-recovery.test.ts:219-236): mid-command RIS, then ConPTY's?1004h ?9001hre-arm alongside a command-armed?1000h, asserts the recorded ground is${PROCESS_BOUNDARY_GROUND}\x1b[?1004h, mouse endsnone, and?1004hsurvives. It fails against the previousowners.clear().
I ran the three touched suites (31 tests) and they pass. The change is additive to the existing ownership tests (keeps an enable after a mid-command full reset owned by the command, keeps a host mode host-owned when a program re-sends its enable) and does not alter the trigger path.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: fbd45eaa-ccb2-4536-a2bb-3fcc4f084f73
📒 Files selected for processing (2)
src/main/daemon/terminal-armed-input-modes.tssrc/main/daemon/terminal-shell-armed-input-mode-recovery.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
…the ground Host ownership covered every mode armed before the first marker, so a tmux that died with mouse on had it re-armed by the ground. And the re-assert's ?1004h enable made the runtime's ownership mirror revoke, so remote owners never settled on Windows. Only ?1004 can be host-owned now, and the ground skips its ?1004l instead of turning it off and back on, so injected bytes carry no enables.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior pullfrog review at 7e57944, the delta is a9c9265 ("let only the host own focus reporting and leave it in the ground"). The two prior minor threads (fish push/pop wording and the synthetic fish fixture) are addressed here and were resolved during this run.
- Only focus reporting can be host-owned (
src/main/daemon/terminal-armed-input-modes.ts): a newHOST_ARMABLE_MODE = 1004andownerForEnable()map a pre-marker enable of any other mode topromptinstead ofhost, andmarkCommandStart()promotes a prompt-owned?1004tohostwhile demoting the rest tostale. Mouse, keypad and kitty armed before the first marker no longer survive a ground. - The ground keeps focus instead of re-asserting it (
src/shared/terminal-mode-reset-profiles.ts,terminal-shell-lifecycle-scanner.ts,terminal-shell-recovery-barrier.ts):buildProcessBoundaryGround({ keepFocusReporting })drops?1004lwhen focus is host-owned, so the emitted bytes carry no enable a consumer scans for ownership;hostPrivateModes/reassertHostModesare gone.PROCESS_BOUNDARY_GROUNDis now the non-focus-preserving variant. - New
process-boundary-host-focus.test.ts: asserts the ground injects only?25h, ConPTY focus survives without a?1004landPtyShellOwnershipMirror.ownersettles onshell, and a command-armed?1004is still grounded. Verified the mouse/focus cases fail against7e57944's re-assertion path. - Test/fixture updates: recovery-suite titles and the fish fixture now use
buildProcessBoundaryGround/ fish's real\x1b[=5u/\x1b[=0usequence; theprocess-boundary-ground.test.tscomment is reworded.
I read the full PR diff and ran the seven touched suites (terminal-shell-lifecycle-scanner, terminal-shell-armed-input-mode-recovery, process-boundary-ground, process-boundary-host-focus, terminal-shell-recovery-barrier, terminal-mode-reset-profiles, agent-foreground-process-wsl-shell-proof) — 92 tests pass.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

ELI5
Orca's terminal backend has a crash detector. When a program dies and leaves settings like mouse capture turned on, the detector turns them off, but it only watched full-screen programs. A small program that turned the mouse on and then exited would leave it on in Orca's backend, and when you came back to that terminal (or opened it on mobile), moving the mouse typed junk into the shell. Now the detector watches for any leftover input settings, not just full-screen ones.
Stacked on #22735, which is stacked on #22732. Windows checks are in progress (see Notes).
What Changed
Before: a normal-screen (not full-screen) program that arms mouse tracking, focus reporting, keypad or kitty keyboard flags and exits without disabling them was cleaned up only in the desktop renderer. The daemon's live emulator kept the modes and re-armed them on the next reattach, and on mobile, where no renderer cleanup runs. That's the #13077 family: mouse reports printed as garbage at the prompt.
Mechanism:
TerminalShellRecoveryBarrieralready grounds a dead program in the recorded stream, but its trigger inTerminalShellLifecycleScanneronly fires when the alternate screen is still up at OSC 133;D ("command finished").After:
TerminalArmedInputModes:?1004and?66?2004and?1are excluded, because shells arm them at their own promptshost(only focus reporting?1004, the one mode a terminal host arms for itself: armed before any OSC 133 marker, like ConPTY's?1004h, or by a prompt that a 133;C proved ended),prompt(armed outside a command, unproven until C),command(armed after C), orstale(anything else still on; the ground clears it but it never triggers). Mouse, keypad and kitty modes are never the host's, so a tmux that dies with mouse on before the first prompt is cleared like any other program. Host arming is sticky, so a program re-sending?1004hchanges nothing. A full reset (ESC c, sent byreset) clears the modes but neither "a command is running" nor host focus ownership: ConPTY answers RIS by re-sending?1004hmid-command, and that must stay the host's. A shell that never emits C (PowerShell without PSReadLine) never has acommandmode, so only an alt-screen death triggers there.commandinput mode".commandand unprovenpromptmodes tostale. It's still gated by the existing shell-foreground proof.PROCESS_BOUNDARY_GROUND(from fix(terminal): one process-boundary ground for every known or proven boundary #22735) is recorded through the stream, so the live emulator and durable history change together.?1004, the barrier emits the ground without its?1004l(buildProcessBoundaryGroundinterminal-mode-reset-profiles.ts, the single source of the byte order). Nothing is turned off and back on, so the injected bytes contain no enables: every consumer that scans them for ownership (the daemon scanner, the runtime'sPtyShellOwnershipMirror, the renderer) sees only disables, and xterm sends no spurious focus report. Kitty flags are cleared on both screens; fish sets them with=5uat its prompt and clears them with=0ubefore running a command. On Windows, ConPTY arms focus reporting before the first prompt for the pane's whole life; without this, the first ground turned it off for good.?2004/?1need nothing extra: bash, zsh and PSReadLine arm them at each prompt and disarm them before 133;C, and the queued prompt after the ground re-arms them. Cold restore keeps the full ground: the seed is written into the emulator before the new ConPTY's first bytes, so its?1004hlands after it.wsl.exe, which the shell proof doesn't recognize. A test pins this, and the renderer keeps covering them. There's no behavior change for WSL.Why
This fixes the stale modes where they originate, in the daemon's recorded stream, so every consumer sees the same state: reattach, mobile and durable history. The alternative was adding more renderer-side reset rules, but that leaves the daemon wrong and still re-arms mobile. It's the third of three changes; the renderer's reset rules stay, as the fallback for hosts and panes the daemon can't prove (WSL, shells without OSC 133, the SSH relay).
Linked Issue
Fixes #13077
Visual Proof
N/A: this is daemon stream behavior with no UI change. It's covered by unit tests and the existing
terminal-reattach-mouse-mode-leake2e (below). #22732/#22735 were validated in the running app separately.Testing
New unit tests fail on fix(terminal): one process-boundary ground for every known or proven boundary #22735's head and pass here (9 of 12 failed before):
noneand no?1004h.Host focus: a stream with
?1004hbefore 133;A, then 133;C, a?1003harm and 133;D;1 ends with focus on and mousenone; the injected ground has no?1004land no enables, and both the barrier and a realPtyShellOwnershipMirrorfed the released bytes settle on ownershell(on the previous head the mirror readundefined). Mouse armed before the first marker is cleared, with no mouse enable in the ground. A?1003hleaked past a refuted proof is turned off by the next confirmed ground.Negative controls:
?2004h/?1hprompt never holdsKitty per-screen and cap cases:
?1049ldoesn't triggere2e
terminal-reattach-mouse-mode-leak.spec.ts: passes on a fresh build. The arming program now stays alive through the warm reattach, and the pane is checked before it is interrupted, so the daemon can't have grounded it and only the renderer's reattach reset can disarm the pane. Dropping mouse modes fromPOST_REPLAY_REATTACH_RESETmakes it fail ("never disarmed",any).Ownership bugs from review (each test fails on dc597b4): a 133;D without a C no longer triggers on host modes; an enable after a mid-command
ESC cstays the command's; a program re-sending a host enable keeps it the host's.Suites and gates:
src/main/daemon: all pass except tworepro-13767real-PTY tests that time out on this machine's sqlite 3.54 (pre-existing).pnpm tc,oxlintandcheck:code-quality:changedare clean.Platform: macOS only so far.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
In progress / open:
?1003h?1006hor?1004hand exits. Expect the proof to pass and the ground to land before the next prompt, and a plaindirnever pauses.Whether ConPTY armsConfirmed (every fresh ConPTY pane sends?1004hat session start.ESC[1t ESC[c ESC[?1004h ESC[?9001hbefore the first OSC 133;A); focus reporting now survives the ground (see After). Still to re-check on Windows.Unchanged:
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)