diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-26 04:01:58 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-26 04:43:49 -0300 |
| commit | 5dab435d7262b87d2cf40d6a27cea9c2d981c2e8 (patch) | |
| tree | aad30de3d26892ff919e7d0bcc7421e10f21c426 /test/tty.zig | |
| parent | 89f51118eb241fdb5673e91eb09e5abe5c6a0bcb (diff) | |
| download | pardes-5dab435d7262b87d2cf40d6a27cea9c2d981c2e8.tar.gz pardes-5dab435d7262b87d2cf40d6a27cea9c2d981c2e8.zip | |
Core, Term: a terminal's emulator and pty are resized once a step and its burst of inputs, at the size the layout settles on, never once a key: a level that borrows a shell's rows and gives them back in one burst resizes neither, and the shell keeps its prompt line (agent M1's find, ymkwwwnn 94f00e966c90: ttyhelp's row 3, the shell's `$`, blank after `SPC ? tutor`); THE CAUSE: Pardes.sync, at the end of every `update` (a key), resized each terminal whose rect changed (Pane.resizeGrid, Term.resize) and queued its pty's resize; `?`'s level takes 3 of the shell's rows (layout.floorRows), `tutor` in the same read gives them back, so the emulator was reflowed twice, and each reflow cleared the prompt line under its cursor for the shell to draw again (ghostty's Screen.resize, clearPromptForRedraw under Terminal.flags.shell_redraws_prompt); bash, told twice with no gap, reads its size once, finds the one it had and draws nothing (the pty probe, .scratch/walkui/T123/bashprobe.py, bash 5.3.20 with pardes's mark: resized 17 -> 14 -> 17 with no gap it writes no byte; 0.3 s apart it writes `\r\e[K\r` and its prompt twice); THE FIX: `sync` is `layOut` (the geometry, every pane's cols and rows, the bands, the greetings) and `sizeTerminals`, which gives each terminal its pane's size when its emulator has another (Term.grid's cols and len: no new state, nothing in the dump), resizes the grid and queues the pty's resize; `update` lays out only, and `settle` (a pump's, a replica's step) sizes the terminals after its queued inputs and before the effects; a 9P request's step (serveFs, a kbdin write of many keys among them), a view's open and close and a watched file's reload keep the whole `sync`; `toView` sizes them before the live view parks (a terminal is sized by one view, `sizes`); a step's own layouts in its middle (a picker's first preview, Pick's showText, showKind and putBack, Query.displayPreview, Store.reopen, jj.open, layout.givePaneRows) call `layOut`; RUN (TEST FIRST): Core.zig "a level that borrows a shell's rows and gives them back in one burst of keys resizes neither its emulator nor its pty ..." boots ttyhelp's layout in the core (100x31, a shell over the +New), gives the shell pardes's bash prompt, focuses the +New and types SPC ? t u t o r with one settle after: fails on the base (two resize_pty effects queued, the shell's first row blank after the settle), passes now; three tests that fed a new shell before any step's end sized it get a `sync` (two in Core.zig) or a `settle` (ninep/pty.zig, pty/ctl's winsize read back after a resize), Term.zig's S1 table counts Core.zig's third Term.grid; the ttyhelp golden re-recorded: row 3 is the shell's `$` again (its leaderworks snap lists 6 rows, not 7); THE MARK (the ruling's second part): ghostty's own bash integration (the genizah's, and the pinned 1.4.0's) marks bash's prompt `133;A;redraw=last;cl=line`: `last` clears only the cursor's line on a resize (bash redraws only a prompt's last line), so it would not have kept M1's one-line `$` either, and ghostty never says `redraw=0` for bash (a narrower reflow would leave the old wrapped rows under bash's redraw): the mark is unchanged (`redraw=last` would keep a multi-line PS1's first lines through a real resize: a separate change, not made); a user hit it whenever a pane beside a shell at its prompt borrowed its rows and gave them back faster than the shell read its size; NEW HOT PATHS: settle and toView walk the panes once (a terminal: Term.grid, its two sizes compared), where sync did per step before; GATES: core-test 1129/1303 (174 skipped: +1, the new test needs a terminal), shell-test 1351/1354 (3 skipped: +1), pane-test 183/184, behaviour-test 285/285 and --replay 20 seeds of 70 steps, 0 failures, process-test 1 of 147 failed (3 skipped): ttyhelp, the golden re-recorded, then 5 of 5 runs alone pass, term-test 17/17, kitty-test 45/45, the gui unit-test 1959/1963 (4 skipped: +1; its perf check's BaselineHarnessMismatch, every base's); no dump change (no new state; effects are local); no frame or perf gate (the user's rule of 2026-11-26); the shots (S kit, 26 px, .scratch/walkui/T123/png): after-0..3, this change's Debug gui: ttyhelp's bare boot, the +New clicked, `SPC ? tutor` in one pty write: the prompt stays on row 3 and the level ends on the +New's tag row as in the golden; before-0..3, the installed stage's (install74): that build's level keeps 7 of the shell's rows after `tutor` (it predates W1's floor), one shrink that bash redraws, so it does not show the fault; load 4.5 to 9.0
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'test/tty.zig')
0 files changed, 0 insertions, 0 deletions
