summaryrefslogtreecommitdiff
path: root/core/Term.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-25 18:35:03 -0300
committerGabriel Schneider <[email protected]>2026-11-27 12:39:39 -0300
commit9890f44e4a18f08b6dcc62a69484b8e93640e1e6 (patch)
tree6f5faa4da41dc0fb72bad31d4637df9c39965554 /core/Term.zig
parent24dc19130fd6a063bb7e86fa21a02d7af4c3b163 (diff)
downloadpardes-9890f44e4a18f08b6dcc62a69484b8e93640e1e6.tar.gz
pardes-9890f44e4a18f08b6dcc62a69484b8e93640e1e6.zip
tty: a terminal pane whose program is mid-frame (synchronized output, DEC 2026) keeps showing its last whole frame until the frame ends or a second has gone, as a terminal holds its picture (ghostty's sync_reset_ms): the user's report of 2026-11-27, "it seems to skip some stuff and then show repeated things", worst in long coding-agent sessions; THE CAUSE: agent TUIs (Claude Code, codex) wrap each redraw in ?2026h…?2026l, and a long session's redraw (Ink's 2J 3J H and the whole transcript) spans many 64 KiB pty reads; pardes drew the pane after each read, so the tty showed the transcript's top again (the repeat) and then the jump to its end (the skip); THE CHANGE: abi Modes.sync (ghostty's synchronized_output, read in terminal.zig's modes), surface Region.held set by draw.zig on a terminal body whose program is mid-frame, and tui.zig's Held: per pane, a held body's rect shows the cells (and the cursor) the tty last showed there; it lets go when the frame ends, after max_ns (1 s, counted from the first held draw), or on a resize or a moved rect; Screen.moving() keeps the loop drawing while one is held; other panes draw live; core/Term.zig's S1 table: modes draw.zig:2; the dump and the digest unchanged (Modes is not dumped; the digest hashes ghostty's modes already); NOT COVERED: the GUI and the 9P /screen file (the raw canonical surface) still show half frames; RUN (TEST FIRST): tui.zig "a terminal mid-frame (synchronized output) shows what the tty last showed of it, until the frame ends or a second has gone" (fails with max_ns 0, passes now); REAL CHECK (.scratch/ttyskip/harness.py: pardes --tty in a pty under pyte, an Ink-like generator in pane 1 over 9P, every outer frame (vaxis's own ?2026l) checked against the app's completed frames replayed from its byte log), 60 s ink runs, ReleaseSafe: the installed 24dc19130fd6 showed 362 of 3166 outer frames that were no completed app frame, this change 0 of 3270, final screens equal; Debug 112/1035 before, 0/965 after (a 60 s Debug run 5/2803: pardes more than 1 s behind lets a torn frame through by design, a 10 s cap gave 0); GATES (Debug tui): core-test, shell-test (1390/1394, 3 skipped), process-test 0 of 149 failed (3 skipped), term-test
Diffstat (limited to 'core/Term.zig')
-rw-r--r--core/Term.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/Term.zig b/core/Term.zig
index 2f0a0f3f..32b98cd9 100644
--- a/core/Term.zig
+++ b/core/Term.zig
@@ -425,7 +425,7 @@ pub const calls = [_]struct { []const u8, []const u8, []const u8 }{
.{ "replies", "Core.zig:1", "WRITE: a step drains the reply buffer (in the digest), counted when it held any (the feed's own unit, which filled it); only the session writes it to the pty (pty_write is off the tape)" },
// ---- reads by a step: in the digest ----
.{ "grid", "Core.zig:3 ansi.zig:3 body_layer.zig:3 draw.zig:2 dump.zig:4 echo.zig:8 exec.zig:2 layout.zig:2 panes.zig:6 replica.zig:2", "READ: the size, the history's length, the cursor: in the digest (a view's place is its pane's; ansi.zig, body_layer.zig, draw.zig, echo.zig: a draw's)" },
- .{ "modes", "Core.zig:5 draw.zig:1 dump.zig:2 echo.zig:3 exec.zig:3 mouse.zig:4 ninep/pty.zig:3 panes.zig:2 replica.zig:1", "READ: the program's modes (mouse, focus, bracketed paste, the alternate screen): in the digest (draw.zig, echo.zig: a draw's; panes.zig: a view scrolls no history on the alternate screen)" },
+ .{ "modes", "Core.zig:5 draw.zig:2 dump.zig:2 echo.zig:3 exec.zig:3 mouse.zig:4 ninep/pty.zig:3 panes.zig:2 replica.zig:1", "READ: the program's modes (mouse, focus, bracketed paste, the alternate screen, a frame under way): in the digest (draw.zig, echo.zig: a draw's; panes.zig: a view scrolls no history on the alternate screen)" },
.{ "prompt", "Core.zig:1 builtins.zig:1 echo.zig:1 exec.zig:3 ninep/pty.zig:1 panes.zig:1", "READ: the OSC 133 cycle: in the digest (`marksOf`); Core.zig's and ninep/pty.zig's also taped (`.prompt`, each side's compared)" },
.{ "promptPrefix", "body_layer.zig:1 edit.zig:1 exec.zig:1", "READ: a row's prompt cells (`promptCut`): the active area's in the digest; a history row's text is not (below)" },
.{ "hasImages", "replica.zig:3 tagline.zig:1", "READ: whether it holds a kitty image (the tag's prefix): in the digest" },