summaryrefslogtreecommitdiff
path: root/core/panes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 16:50:34 -0300
committerGabriel Schneider <[email protected]>2026-11-22 16:53:19 -0300
commit9863a63b614d200852853825031189364dcacfdc (patch)
treed235648a2ac14b3e311746ced3433ed6865e2061 /core/panes.zig
parent6544f73a6b50e5ba68564beea7784593bb54348e (diff)
parentbad506bd45846e012246a33b5d3097b3e92f02bc (diff)
downloadpardes-9863a63b614d200852853825031189364dcacfdc.tar.gz
pardes-9863a63b614d200852853825031189364dcacfdc.zip
integration: the old road deleted and the emulator's boundary on the gathered line: pardes-merge56 (`qvwrwxtu`: the installed tree and the source view's changes to their last slice) and pardes-term-join-9 (`twssqzqw`, fourteen changes on pardes-merge55: every client's terminals by the pty's bytes and nothing else: the delta protocol, its flow control and core/term/screen_state.zig deleted (-3,605 +504 lines), the wire at 30, one soak; S1: abi/term.zig's Ops in replicated and local, the terminal's digest covering what a step reads, every call of the core's into a terminal listed with its rule as a test; a client's own join again judged after its goodbye; a pty's size one fact the core hands its host for every fork, adopt and resize; a closed view sizes no terminal); no textual conflict; one semantic one, resolved here: core/jj.zig's Churn test (the layers' last round) called Authority.init and Replica.init with the road's flag the deletion took away: the argument removed; core-test 916/1073 (157 skipped), shell-test 1115/1118; its gate: .scratch/sketch/reorg/merge57, the numbers in PARDES.md (2026-11-22)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/panes.zig')
-rw-r--r--core/panes.zig49
1 files changed, 8 insertions, 41 deletions
diff --git a/core/panes.zig b/core/panes.zig
index 289de70f..d9759d18 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
@@ -372,9 +367,10 @@ pub const Pane = struct {
/// The views `pv` holds a share for (a pane retired before a view came
/// has none of it).
pv_known: u8 = 0,
- /// The view that last typed into it: a terminal shown at two sizes takes
- /// that view's (Pardes.sync).
- sized_by: u8 = 0,
+ /// The view that last typed into it, while that view is open: a
+ /// terminal shown at two sizes takes that view's (Pardes.sync); none,
+ /// it keeps the size it has.
+ sized_by: ?u8 = 0,
/// A terminal shown in a view shorter than it (one that does not size
/// it): the rows its top is passed over by, so its cursor stays in
/// sight (Pane.panFor); 0 everywhere else.
@@ -642,7 +638,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 +738,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 +757,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 +867,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 +949,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 +963,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,12 +978,8 @@ pub const Pane = struct {
pane.clearPointerSelection(button);
pane.sel[button].state = .none;
};
- if (tape.screenReplica()) return;
if (tape.speculating()) return tape.touchTerminal();
- // A client typing at another size than the last typist's read
- // history rows its replay held as holes, and the rows came
- // renumbered (2026-10-30): the authority's waits for the unit.
- Term.resize(state, cols, rows, tape.screenAuthority());
+ Term.resize(state, cols, rows);
}
/// The rows its terminal's top is passed over by in a view whose rect
@@ -1155,7 +1130,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
@@ -1176,13 +1150,6 @@ fn written(s: *Term.State) bool {
return s.written;
}
-/// The sizes steps gave terminals (`Pane.resizeGrid`), made: between
-/// units, on an authority with screen-state replicas (replica.Peers.unit).
-pub fn resizeDeferred(p: *Pardes) void {
- for (p.panes) |slot| if (slot) |pane| if (pane.terminal) |state| if (Term.resizeDeferred(state))
- p.shell_rows.markStale(pane);
-}
-
/// A pane with nothing in it yet, `cols` by `rows`: what a file, a
/// directory, a kind's pane or a terminal is made from.
pub fn createDoc(gpa: std.mem.Allocator, cols: u16, rows: u16) !*Pane {