diff options
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 |
