summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 03:39:43 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit84d23aef86c0bcb6ee14bb69b1e4d6d65205e2f6 (patch)
treef45ab1d07c16ceec51d8c164ad210aa220efe484 /test
parent98e94b86a7c38e2bf4d66e57144fc9329906bb3b (diff)
downloadpardes-84d23aef86c0bcb6ee14bb69b1e4d6d65205e2f6.tar.gz
pardes-84d23aef86c0bcb6ee14bb69b1e4d6d65205e2f6.zip
size says its limits, keeps every pane its rows, and ptys follow their panes
size refused an out-of-range line without saying the range, took a size too small for the panes (leaving bodies of no rows), and a terminal squeezed to its tag kept a pty of its old size. The refusal now names 20x6 to 4096x4096 (a bare size is EINVAL like any malformed line), a size that would leave any pane less than its tag and 2 rows is refused and undone, and a terminal's pty is resized with its pane down to one row (only a folded or unplaced one keeps its grid). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
-rw-r--r--test/panes.zig26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/panes.zig b/test/panes.zig
index 25f0f6db..ca53af3d 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -4890,3 +4890,29 @@ const LookResetTests = struct {
test {
_ = LookResetTests;
}
+
+test "a terminal's pty follows its pane down to its last row" {
+ const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 100, .rows = 30 });
+ defer p.deinit();
+ p.presentation.enabled = false;
+ p.sync();
+ while (p.nextEffect()) |_| {}
+ const term = for (p.panes, 0..) |slot, i| {
+ if (slot) |pane| if (pane.isTerminal()) break i;
+ } else return error.NoTerminal;
+ p.newScratchBelow(term);
+ p.sync();
+ while (p.nextEffect()) |_| {}
+ // The terminal squeezed to its tag alone, folded by nobody.
+ p.panes[term].?.vweight = 0.01;
+ for (p.col_panes[0][0..p.col_n[0]]) |k| if (k != term) {
+ p.panes[k].?.vweight = 1000;
+ };
+ p.sync();
+ try std.testing.expect(p.rects[term].h <= p.panes[term].?.tag_rows);
+ var rows: ?u16 = null;
+ while (p.nextEffect()) |effect| if (effect == .resize_pty and effect.resize_pty.pane == term) {
+ rows = effect.resize_pty.rows;
+ };
+ try std.testing.expectEqual(@as(?u16, 1), rows);
+}