From 70881bb4edd15fe918ee5fed4ed3e8922bc7fc6a Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 09:58:15 -0300 Subject: A command or terminal pane refused for room is refused before anything is logged or answered of it, and a serial is never handed out twice A command pane with no room logged `new N` and `run N ls`, was answered to its exec, then went with `del N` and no `exit N`; and sync gave N back (`next_serial -= 1`) to the next pane made, so a script holding N found another pane under it. Tty did the same. Both now take a refused placement back at once, before the run is logged or the serial answered (the pane was never announced, so it leaves no record), and fail the write with no room. The decrement is gone: gaps are fine, and a serial once said names one pane for good. Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 0690b7eb..4e578791 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -7119,13 +7119,9 @@ pub const Pardes = struct { var refused = false; while (p.unplaced.findFirstSet()) |id| { p.unplaced.unset(id); - if (p.panes[id]) |pane| { - // Refused, it was never there: the serial it took is the - // next pane's, as a refused Newcol's column serial is. - const newest = pane.serial == p.next_serial; - p.removePane(id, null) catch {}; - if (newest and p.panes[id] == null) p.next_serial -= 1; - } + // Refused, it was never there. Its serial is not handed out + // again: one logged or answered names this pane for good. + if (p.panes[id] != null) p.removePane(id, null) catch {}; refused = true; } // A refused pane gone, no pane it squeezed stays under its minimum. -- cgit v1.3