From 05826d5148b8d75c32397380b9f64e0b3477e5bb Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 30 Oct 2026 16:16:25 -0300 Subject: replica: pardes's own steps over a terminal speculated, not every input while one has the keyboard (H14): what reaches its program is a pty write and stops as before; its view (normal-mode keys, the wheel, Ctrl-u) moves here at once, the rollback copy keeping each terminal's view (it holds no emulator) and a delta setting it, put back between the units it replays in the order the deltas came among them; what was applied over a terminal applied again over each delta or rows that come while it waits, and its unit taken at once rather than kept to replay over later deltas; closing a terminal stops (its pty's end is the authority's) Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 81ea0cdd..22f446a5 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -5226,6 +5226,9 @@ pub const Pardes = struct { for (p.panes, 0..) |slot, id| if (slot == pane) { if (watched) p.emit(.{ .watch = .{ .pane = @intCast(id), .on = false } }); if (pane.isTerminal()) p.emit(.{ .close_pty = .{ .pane = @intCast(id) } }); + // Its pty's end and its emulator are the authority's: a replica's + // speculation that closes a terminal waits for it. + if (pane.terminal != null) tape.poison("close a terminal"); ctlfs.events.noteRetire(p, pane); // ...and so do bytes still queued for the pty it no longer has. p.dropPendingWrite(id); -- cgit v1.3