From 3eaa4af06c5f997f5d054fde149f7bcc26f1fea3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 03:45:25 -0300 Subject: A command run from a column's tag gets its pane in that column A command from a column's tag ran in a command pane at the foot of the last column, however far from the tag, and could reuse a finished one anywhere. It now goes to the tag's column, under both placements, and reuses only a finished command pane in that column. Co-Authored-By: Claude Opus 5.5 --- src/ninep/cols.zig | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/ninep') diff --git a/src/ninep/cols.zig b/src/ninep/cols.zig index c55c1e73..ef2e6cbd 100644 --- a/src/ninep/cols.zig +++ b/src/ninep/cols.zig @@ -337,3 +337,22 @@ test "a word run from the workspace's or a column's tag runs in the session's di const made = p.paneBySerial(p.fs.results[0]).?; try testing.expectEqualStrings(pardes.Pardes.paneDir(p.panes[0].?), pardes.Pardes.paneDir(p.panes[made].?)); } + +test "a command run from a column's tag gets its pane in that column, not the last" { + const p = try th.withFile(testing.allocator, "x\n"); + defer p.deinit(); + p.newColumn(p.active); + p.newScratchFor(p.active, .fs); // fills the new, right column + p.sync(); + const left = layout.columnSerial(p, 0); + try testing.expectEqual(tree.Status.ok, th.wr(p, Node.ofCol(left, .exec), "true\n").reply.status); + const made = p.paneBySerial(p.fs.results[0]).?; + try testing.expectEqual(@as(usize, 0), layout.findPane(p, made).?.col); + // Finished, it is reused only by its own column's commands. + p.panes[made].?.command_done = true; + p.panes[made].?.command_pty = false; + try testing.expectEqual(tree.Status.ok, th.wr(p, Node.ofCol(layout.columnSerial(p, 1), .exec), "true\n").reply.status); + const other = p.paneBySerial(p.fs.results[0]).?; + try testing.expect(other != made); + try testing.expectEqual(@as(usize, 1), layout.findPane(p, other).?.col); +} -- cgit v1.3