From 84d23aef86c0bcb6ee14bb69b1e4d6d65205e2f6 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 03:39:43 -0300 Subject: 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 --- test/panes.zig | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/panes.zig') 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); +} -- cgit v1.3