From 6118ad214bb74744e7b38004b34e4487a6635be1 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 30 Oct 2026 01:51:44 -0300 Subject: replica clients' terminals as screen state: the session's Peers keep a Screens (rterm's), a peer each: the rows a pump's steps read before its unit, the deltas after it, and before each client input's step, the rows it read before its unit; a joiner's terminals afresh after its dump; acks, rows asked and resets from the client (0x04) taken at the boundary; units carry no pty bytes and a word of digest The client applies a delta or rows (0x06) in stream order and asks for the rows it shows and lacks after each frame; its dump's emulators are loaded on the C heap (walk.zig `.alloc` of a pane's `terminal`, dump.zig `terminal_gpa`), as `terminal.create` makes a screen replica's. Its load checked under its own tape (no emulator in the digest). tty.zig: with replica clients, a wait takes one step of a person's input and none after a pty's output (`split`): the next is held for the next wait, so a step reads the terminals as the deltas after each unit bring them. Screens: `dropPeer` (clients come and go), its numbers reused. Co-Authored-By: Claude Opus 5.5 --- src/dump.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/dump.zig') diff --git a/src/dump.zig b/src/dump.zig index cb639568..152495e2 100644 --- a/src/dump.zig +++ b/src/dump.zig @@ -129,6 +129,10 @@ pub fn defaultDirectory(buf: []u8) ?[]const u8 { return null; } +/// What a load makes a terminal's emulator with, when not the loader's +/// own: a screen-state replica's are the C heap's (src/replica.zig). +pub var terminal_gpa: ?std.mem.Allocator = null; + // ---- a whole session to and from a dump (acme keeps this in rows.c) ---- // // A dump (src/walk.zig) is everything the session is but what is the @@ -231,7 +235,7 @@ fn loadKnowing(gpa: std.mem.Allocator, opts: Options, bytes: []const u8, notes: p.fs.deinit(gpa); gpa.destroy(p); } - l.allocs = .{ .image = p.image_gpa, .pdf = p.pdf_gpa }; + l.allocs = .{ .image = p.image_gpa, .pdf = p.pdf_gpa, .terminal = terminal_gpa }; try l.into(Pardes, p); const read = l.shared.items.len; const mounts = try l.get([]const filesystem.Mount); -- cgit v1.3