Commit e2b0430
committed
Stage 2b: prepare, commit and recover renderer frames
Upstream's renderer emits while it thinks, so the frame is recorded off-lock
and replayed under one transaction only after its geometry, output, owner and
terminal generations still match. A managed write, resize, owner change or
handoff in between retires the batch without emitting a byte of it.
Discarding the output is only half of discarding the frame. The renderer has
already advanced: _last_screen became a baseline for a frame the terminal never
received, and the mode flags latch beside their emission, so a full repaint
never re-emits them. Recovery drops the baseline and re-establishes a small
enumerated state contract physically, then tells the renderer what is true --
not a snapshot of upstream fields, and not upstream's reset(), which emits
operations of its own and rewrites available-height bookkeeping.
Cursor position replies are correlated by order, since the wire carries no
generation, and a row inside the reserved band is rejected before it can set a
height that upstream would have computed as zero or negative.
The contract tests record why each of those choices is necessary against
prompt_toolkit 3.0.53, so an upgrade that changes them fails loudly.1 parent 1850173 commit e2b0430
6 files changed
Lines changed: 1158 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
0 commit comments