summaryrefslogtreecommitdiff
path: root/core/Core.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-22 20:21:32 -0300
committerGabriel Schneider <[email protected]>2026-11-22 20:21:32 -0300
commit3f250d0f963f375d699f11ffc02b07f2e2cbbbee (patch)
tree4e5a1f577fd3dd247f3643d979868347524ce703 /core/Core.zig
parent34e2d82a322bd3767a8ec62b3a4c0894399e8c04 (diff)
parentc607dc14502a6956bdfa3575bc7363514a7abeb4 (diff)
downloadpardes-3f250d0f963f375d699f11ffc02b07f2e2cbbbee.tar.gz
pardes-3f250d0f963f375d699f11ffc02b07f2e2cbbbee.zip
integration (a base for the terminals' next round, not yet the gathered line): the viewport in the view and the patches in the semantics hash on merge58 with the terminal put back: pardes-raw-tty (`muwnrqro`, on pardes-merge58: a TERM that reaches a session while it leaves its terminal no longer leaves it raw: `Killed.disarm` puts the cooked modes back itself, `leave` calls it last) and pardes-term-join-10's two changes (`xktusoyq` on `qtxssxyk`, on pardes-term-join-9: where a view stands in a terminal's history is the view's (`Pane.scrolled_to`), carried once a confirmed write that moves rows, the wire at 31; build/patches hashed into a replica's semantics); no conflict; core-test 917/1077 (160 skipped), shell-test 1119/1122, pane-test 182/183, term-test 16/16; NOT gated whole: the viewport's gate had one perf count over its budget ("terminal on all" +0.235%), which the next round brings down before this is the gathered line (2026-11-22)
Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/Core.zig')
-rw-r--r--core/Core.zig18
1 files changed, 9 insertions, 9 deletions
diff --git a/core/Core.zig b/core/Core.zig
index 2b0a898d..a35cea8e 100644
--- a/core/Core.zig
+++ b/core/Core.zig
@@ -1974,7 +1974,7 @@ pub fn sync(p: *Pardes) void {
// doc panes have no pty/emulator grid to reflow; just record
// the size so bodyText renders the right number of rows
if (pane.isTerminal()) {
- pane.resizeGrid(cols, rows);
+ pane.resizeGrid(p.live, cols, rows);
p.shell_rows.markStale(pane); // reflow moved every row
p.emit(.{ .resize_pty = .{ .pane = .at(id), .cols = cols, .rows = rows } });
pane.fs.winsize = null;
@@ -3866,11 +3866,11 @@ test "raw terminal cursor follows its active row only while that row is visible"
try std.testing.expectEqual(rect.x + config.GUTTER + 3, live.x);
try std.testing.expectEqual(body_y + 2, live.y);
- pardes.Term.scroll(pane.terminal.?, -1);
+ pane.scrollBy(-1);
const scrolled = (try p.render(frame.allocator())).cursor orelse return error.MissingCursor;
try std.testing.expectEqual(live.x, scrolled.x);
try std.testing.expectEqual(live.y + 1, scrolled.y);
- pardes.Term.scroll(pane.terminal.?, -@as(i32, pane.rows));
+ pane.scrollBy(-@as(i32, pane.rows));
try std.testing.expect((try p.render(frame.allocator())).cursor == null);
pane.followOutput();
const returned = (try p.render(frame.allocator())).cursor orelse return error.MissingCursor;
@@ -3920,31 +3920,31 @@ test "tty output follows only from the bottom" {
p.update(.{ .output = .{ .pane = .at(shell), .bytes = std.fmt.bufPrint(&buf, "line {d}\r\n", .{i}) catch unreachable } });
}
p.sync();
- const bottom = pardes.Term.grid(sp.terminal).offset;
+ const bottom = sp.termTop();
try std.testing.expect(bottom > 0);
// Scrolled back, the reader stays put however much the shell prints.
sp.scrollBy(-10);
p.sync();
- const parked = pardes.Term.grid(sp.terminal).offset;
+ const parked = sp.termTop();
try std.testing.expect(parked < bottom);
for (60..70) |i| {
var buf: [32]u8 = undefined;
p.update(.{ .output = .{ .pane = .at(shell), .bytes = std.fmt.bufPrint(&buf, "line {d}\r\n", .{i}) catch unreachable } });
}
p.sync();
- try std.testing.expectEqual(parked, pardes.Term.grid(sp.terminal).offset);
+ try std.testing.expectEqual(parked, sp.termTop());
// Typing snaps back to live output, so nobody types blind.
p.update(.{ .key = .{ .cp = 'x', .text = "x" } });
p.sync();
- try std.testing.expect(pardes.Term.grid(sp.terminal).offset > parked);
+ try std.testing.expect(sp.termTop() > parked);
// ...and from there output follows again.
- const live = pardes.Term.grid(sp.terminal).offset;
+ const live = sp.termTop();
p.update(.{ .output = .{ .pane = .at(shell), .bytes = "tail\r\n" } });
p.sync();
- try std.testing.expect(pardes.Term.grid(sp.terminal).offset > live);
+ try std.testing.expect(sp.termTop() > live);
}
test "an unasked desktop paste reaches a tty pane's program, not its buffer" {