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 --- src/pardes.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 72fd4d46..c103b9d7 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -6527,7 +6527,10 @@ pub const Pardes = struct { } else pane.tag_top = 0; const cols = @max(1, r.w -| config.GUTTER); const rows = @max(1, r.h -| pane.tag_rows); // the tag steals the top rows - if ((cols != pane.cols or rows != pane.rows) and r.h > pane.tag_rows) { + // A terminal's pty follows its pane down to a row, whatever the + // resize; only a folded one keeps the size it had, and one not + // placed yet the grid it was made with. + if ((cols != pane.cols or rows != pane.rows) and (r.h > pane.tag_rows or (pane.isTerminal() and !pane.collapsed and r.h > 0))) { // doc panes have no pty/emulator grid to reflow; just record // the size so bodyText renders the right number of rows if (pane.isTerminal()) { -- cgit v1.3