diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-22 10:39:52 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-22 10:39:53 -0300 |
| commit | 94561bf0e13d034384eae01d2cb9d48a8fe0a502 (patch) | |
| tree | 1a7ba2b66e6fbe69b06457863dc8e732435fb265 /core/panes.zig | |
| parent | 9158de5d50831e115e14e2ed502300ee8c1d9930 (diff) | |
| download | pardes-94561bf0e13d034384eae01d2cb9d48a8fe0a502.tar.gz pardes-94561bf0e13d034384eae01d2cb9d48a8fe0a502.zip | |
tape: no screen-state branch left, and a terminal's kitty images are each side's own emulator's again (the old road's deletion, piece 6 of 8): core/tape.zig loses `Tape.screen_state` and every branch on it (a terminal's output recorded without its bytes, the positions and prompt checks skipped, `screenReplica`, `screenAuthority`, `screenState`, `viewOnly`, which on the one road did nothing), and the tape site `images`; core/panes.zig its replica branches (a feed skipped and the session's positions taken, a view's scroll or follow noted, a resize left to the authority, the reloads at a join skipped); core/Term.zig a terminal's digest that returned early under screen state, and the medium read that went past the tape; core/dump.zig a join's dump always holds each terminal whole (`slim_terminals` stays for the exit dump); the tests' `t.screen_state = false` lines (4 in core/replica.zig, 3 in test/replicas.zig); THE IMAGES (the brief's choice): `Pane.term_images` and its taped read after each output (pardes-image-loop's cure for a screen-state client, whose emulator never held an image) go, the tag reads `Term.hasImages` again (core/tagline.zig), and a terminal's digest holds whether it has an image (core/term/terminal.zig `digest`: one bool among its facts), so the fact the tag shows is covered by the digest it is computed from (S1's rule) rather than by a pane field copied after each output, and a parting over it is named at the terminal; abi/wire.zig's line for 30 says so (the dump's shape changed with it); the image-loop's test runs on the one road (the client's emulator has the image, its tag says what the session's does); core-test 911/1068 (157 skipped), shell-test 1110/1113, term-test 15/15, pane-test 181/182, kitty-test 45/45, the soak's small run and `--echo` rc 0 (diverged 0, unequal 0, corpus 22)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/panes.zig')
| -rw-r--r-- | core/panes.zig | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/core/panes.zig b/core/panes.zig index d58bf30b..a2e383c1 100644 --- a/core/panes.zig +++ b/core/panes.zig @@ -134,11 +134,6 @@ pub const Pane = struct { /// cell), and its kitty graphics drawn as glyph art (Petscii). term_mouse: ?Term.Coordinate = null, term_petscii: bool = false, - /// Whether its terminal holds a kitty image, as the session's emulator - /// said after its program's last output (taped under screen state: a - /// client's emulator is fed the session's cells, never an image). Its - /// tag says so (tagline.zig), on every side. - term_images: bool = false, gpa: std.mem.Allocator, serial: u32 = 0, /// What the control filesystem keeps of this pane -- addr and limit, the @@ -642,7 +637,6 @@ pub const Pane = struct { } } else if (pane.addon == null) { // the vt scrolls in SHELL rows; convert through the edit buffer - if (tape.viewOnly("scroll a terminal")) return; const state = pane.terminal orelse return; const off: i32 = @intCast(Term.grid(state).offset); Term.scroll(state, pane.gridRow(pane.surfRow(off) + delta) - off); @@ -743,12 +737,6 @@ pub const Pane = struct { const has_positions = pane.ovl != null or pane.body.cur_pinned or pane.body.vsel.active or pane.body.nsel > 0 or pane.body.last_edit != null or pane.look_at != null or pane.body.ed_undo_len > 0 or pane.body.ed_redo_len > 0 or pane.pointerRowCount() > 0; - // A replica's emulator is what the authority's deltas make it; what - // pardes keeps over it moves as the authority's feed told it. - if (tape.screenReplica()) { - if (has_positions and pane.followRows(state, bytes)) if (paneIdOf(p, pane)) |id| p.setMessage(.at(id), positions_lost); - return; - } // Sticky bottom, as every other terminal does it: output drags the // viewport down only when the viewport was already on the last row, // so a reader scrolled back into the scrollback stays where they @@ -768,7 +756,6 @@ pub const Pane = struct { /// pointer's rows) moved as the rows move (`Term.Told`). True when one /// could not be kept (no memory for its pin). fn followRows(pane: *Pane, state: *Term.State, bytes: []const u8) bool { - const on_replica = tape.screenReplica(); const Group = struct { overlay: ?*Text.EditBuffer, cursor: *i32, selection: *Text.CharSel }; var groups: [Text.history_max * 2 + 1]Group = undefined; groups[0] = .{ @@ -879,13 +866,7 @@ pub const Pane = struct { track[k] = at.grid; k += 1; }; - // A replica's emulator is fed by its authority's deltas: it is told - // what the authority's feed told. - const fed: Term.Told = if (on_replica) told: { - @memset(rows_after, 0); - @memset(erased_after, false); - break :told .{ .rows = rows_after, .erased = erased_after, .cleared = false, .alive = false, .failed = false }; - } else Term.feed(state, bytes, track, rows_after, erased_after); + const fed = Term.feed(state, bytes, track, rows_after, erased_after); const after = tape.value(.positions, keepTold, .{Term.Told{ .rows = fed.rows, .erased = fed.erased, .cleared = fed.cleared, .alive = fed.alive, .failed = failed or fed.failed }}); if (after.rows.len != n or after.erased.len != n) return false; // a replica its authority's states apart (diverged) failed = after.failed; @@ -967,7 +948,7 @@ pub const Pane = struct { } fn feedLost(state: *Term.State, bytes: []const u8) bool { - if (!tape.screenReplica()) _ = Term.feed(state, bytes, &.{}, &.{}, &.{}); + _ = Term.feed(state, bytes, &.{}, &.{}, &.{}); return true; } @@ -981,14 +962,11 @@ pub const Pane = struct { /// Its terminal's view snapped back onto live output. pub fn followOutput(pane: *Pane) void { - if (tape.viewOnly("follow a terminal")) return; const state = pane.terminal orelse return; Term.follow(state); } - /// Its terminal's grid reflowed to `cols` by `rows`: on a screen-state - /// replica by its authority (the next delta says), on such an authority - /// once the step's unit is out (`resizeDeferred`). + /// Its terminal's grid reflowed to `cols` by `rows`. pub fn resizeGrid(pane: *Pane, cols: u16, rows: u16) void { // A client's speculation does what its replay does (its // selections) but the grid: it waits for no round trip. Under bytes @@ -999,7 +977,6 @@ pub const Pane = struct { pane.clearPointerSelection(button); pane.sel[button].state = .none; }; - if (tape.screenReplica()) return; if (tape.speculating()) return tape.touchTerminal(); Term.resize(state, cols, rows); } @@ -1152,7 +1129,6 @@ pub const positions_lost = "terminal edit position reset: out of memory"; /// session's snapshot's hash is taped, and each replica's own compared /// with it: a check of the whole emulator at every join. pub fn reloadTerminals(p: *Pardes) void { - if (tape.screenState()) return; for (p.panes) |slot| if (slot) |pane| if (pane.terminal) |state| { if (!tape.value(.reload, written, .{state})) continue; // Its cells' size in pixels as a feed sets it (`feedOutput`): a |
