From edbdfdd988870caaa11f4676d48c6cecc16e45be Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 30 Oct 2026 18:15:20 -0300 Subject: terminal: a step that reads a terminal's rows as the core keeps them marks it read too: `fill` sent a client that came since (its history all holes) none of the rows the step read shellRows set `read` only when it built the rows, not when it handed out the ones kept since the last write, so after a client joined (or was started afresh) a step reading through the cache left the client's holes unsent, and it replayed the step on blanks. Found on the way to H18, whose fix is fixer 1's (wwkwwlzt). Test (failing before): a step that reads a terminal's rows as the core keeps them sends a new client the ones it holds as holes. Co-Authored-By: Claude Opus 5.5 --- src/terminal.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/terminal.zig') diff --git a/src/terminal.zig b/src/terminal.zig index 01a9777e..ade2311d 100644 --- a/src/terminal.zig +++ b/src/terminal.zig @@ -1800,7 +1800,12 @@ pub fn shellRows(p: *Pardes, pane: *Pane) ![]const []const u8 { if (comptime !enabled) return &empty_grid; if (pane.terminal == null) return &empty_grid; const c = &p.shell_rows; - if (!c.stale and c.pane == pane) return c.rows; + if (!c.stale and c.pane == pane) { + // A step's read whether the rows are kept or made: a client that + // came since holds them as holes, and is sent them (Screens.fill). + if (!drawing) pane.terminal.?.read = true; + return c.rows; + } // Another pane's rows, or a dropped pane's still waiting for the step's // sweep (dropPane keeps them, as they may still be borrowed): this // step's rows are scratch, and nothing in the slot is written over. -- cgit v1.3