summaryrefslogtreecommitdiff
path: root/core/ansi.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 17:55:03 -0300
committerGabriel Schneider <[email protected]>2026-11-22 19:48:03 -0300
commit8e850e6c923dcd84b7a5483f73377bd192b94a2b (patch)
tree0730a84095f75d8a46e4dcdfebddb8d8b90af7c6 /core/ansi.zig
parentbad506bd45846e012246a33b5d3097b3e92f02bc (diff)
downloadpardes-8e850e6c923dcd84b7a5483f73377bd192b94a2b.tar.gz
pardes-8e850e6c923dcd84b7a5483f73377bd192b94a2b.zip
terminals: where a view stands in a terminal's history is the view's, not the emulator's (pardes-term-join-10, item 1; the note's point 3, the coordinator's choice): `Pane.scrolled_to` (core/panes.zig), a per-view field (views.zig `pane_fields`, `PaneView`: in the rollback copy, the digest and the dump, each view's own), the row its top shows or null on the output, written only by a step (`scrollBy`, `followOutput`), and carried with every open view's through each write of the emulator that moves rows, once, in the confirmed unit's apply, on every side alike (`Term.feed`/`Term.resize` take the places; core/term/terminal.zig `carry`/`carried` pin each place's row on the primary screen and read the pin back: up by the rows the history drops, 0 when its own row goes, null in the active area or after a reset: a function of the fed bytes); the draw reads the rows from the view's place (`viewport`, `paint`, `ImagesAt.place`, terminal.zig `shown`), and ghostty's own viewport is never moved, read, digested or dumped (`Grid.offset`/`view`, `Parts.view` and the digest's offset gone): two clients no longer scroll one viewport (the new views.zig test failed on the base, `expected 80, found 77`), and a speculation's scroll is in the copy, so `putViews`, the view half of `keepViews` (now `keepSerials`), `viewTo`/`scroll`/`follow` (ops, wrappers, bodies), the Debug screen hash's view exclusion, `reflow`'s column-0 cure and `feedOutput`'s follow-after-read are deleted, and S1's `calls` lists no view write (the rows `viewTo`, `scroll`, `follow` gone); tests: the two-view test (with a dump), the place at the history's cap (`setMaxBytes(1)`), a 300-seed fuzz of the carried place against ghostty's own pinned view, a client's wheel over a shared terminal through output and a rollback, round 6's order explorer (30 seeds a run); the wire at 31 (abi/wire.zig, test/daemon.py `WIRE`): an installed build's dump loads with every view on the output; IN THE WORKSPACE core-test 912/1072 (160 skipped), shell-test 1114/1117 (3 skipped), term-test 16/16, kitty-test 45/45, pane-test 181/182, behaviour-test 275/275, --replay 275/275, process-test 0 of 146 failed, as pairs 0 of 146; gui unit-test 1707/1711, its one error BaselineHarnessMismatch (every base's)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/ansi.zig')
-rw-r--r--core/ansi.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/ansi.zig b/core/ansi.zig
index 5f522536..14553817 100644
--- a/core/ansi.zig
+++ b/core/ansi.zig
@@ -86,7 +86,7 @@ pub fn recolor(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, tx: u16, tw
const tz_paint = tracy.zone(@src(), "termPaint");
defer tz_paint.end();
const ink = inkOf(p.theme());
- Term.paint(state, &ink, &p.tty_filter_palette, pane.tty_filter, @intCast(lo), cols, cells, rows);
+ Term.paint(state, &ink, &p.tty_filter_palette, pane.tty_filter, pane.scrolled_to, @intCast(lo), cols, cells, rows);
}
const filtered = pane.tty_filter;
// Which buffer lines the user has not actually changed, so a row swallowed
@@ -221,6 +221,7 @@ pub fn images(p: *Pardes, s: *Surface, pane: *Pane, id: usize, tx: u16, tw: u16,
rows_of[@intCast(vi)] = vr;
}
Term.images(state, p.gpa, .{
+ .place = pane.scrolled_to,
.pane = @intCast(id),
.serial = pane.serial,
.tx = tx,
@@ -440,7 +441,7 @@ pub fn recolorDiffOutput(p: *Pardes, s: *Surface, pane: *Pane, r: pardes.Rect, t
const line = shown.next() orelse continue;
const vr: i32 = @intCast(vi);
const w = pane.wrapAt(p.settings.tab, vr);
- const row_i: i32 = if (raw) @as(i32, @intCast(panes.Term.grid(pane.terminal).offset)) + vr else w.line;
+ const row_i: i32 = if (raw) @as(i32, @intCast(pane.termTop())) + vr else w.line;
if (row_i < 0 or row_i >= @as(i64, @intCast(rows.len))) continue;
const row: usize = @intCast(row_i);
const from: usize = if (raw) 0 else @intCast(@max(0, w.at));