fix(app): closing a replay-opened split keeps the line carried for another terminal (P0 1193)

LA
5d ago
+20-2

Summary

P0 1193 family (re-review of #29693 at bc84781571b, lower finding 1, which I first closed wrongly as unreachable in #29758): a held Cmd-D that runs again at a hold's end opens a new hold that holds only that split's creation (its awaited set is empty) plus the keys carried into it for other terminals (#29693's adopted lanes). If the person closes that split before its reply, CreationInputBuffer.cancel(tab:) found nothing waiting and dropped every held key, also the line carried for another terminal.

Fix: when nothing waits any more, cancel(tab:) drops only keys with no terminal of their own: no lane, or a lane with no tab (they must never run into whatever has the focus, the rule of 514770ead3c). A key whose lane names a terminal stays and goes to that terminal when the hold ends (the coordinator flushes after a cancel). Unlike the closed #29758, tab-less lanes are still dropped.

Base: stacked on #29693's branch fix/p0-1193-followup-v2; after #29693 merges, the base moves to feat-cmux-next (no rebase).

Testing

Red-first, a unit test of the buffer: CreationInputHoldTests.closingAReplayOpenedSplitKeepsTheLineCarriedForAnotherTerminal (a replay-opened hold with only the split's creation; the rest of the replay prepended: a key of the issuing lane, which moves to the split, and a line carried for terminal B; the split closes; B's line must stay and the split's key must go).

RefWhat it isJobResult
c313b63a4d9#29693's head + the test only646f18fdfaf0bb1eb6a49cc9the new test fails on its outcome: take() == [] ("the line carried for terminal B was dropped with the closed split"); 5 others pass
d0ec8faf938 (this head)the fix377087b32eeb802ad9d2a067CreationInputHoldTests 6 of 6; SecondCreationKeysTests 10 of 10 (no regression in #29693's tests)

Display steps (console session, CMUX_TEST_REQUIRE_GUI=1). Compiles: head da72349dd91c59aee1f6bb8b, red 715a66681adb304f622503a6.

Observed / Not run

Observed: the two runs above, logs read before counting. Not run: an end-to-end sequence with real keys (held Cmd-D replayed, Cmd-W on the new split before its reply, then the other terminal's line); the buffer test covers the rule, and the coordinator path after a cancel is unchanged.

Performance

No perf numbers: a correctness fix in a filter on held keys. perf claim: none.

Changelog

Fixed: Closing a new pane while it is still opening no longer drops a line typed for another pane

Proof

No capture: key routing inside the hold; the evidence is the fleet tests above.