summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 03:45:25 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit3eaa4af06c5f997f5d054fde149f7bcc26f1fea3 (patch)
treee7d9d3a2f44af3c8b69740f8ac7acb63a99e6cfd /src/ninep
parent69f8e4703f6c1204f9f0958f264d2a4c4600026f (diff)
downloadpardes-3eaa4af06c5f997f5d054fde149f7bcc26f1fea3.tar.gz
pardes-3eaa4af06c5f997f5d054fde149f7bcc26f1fea3.zip
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 <[email protected]>
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/cols.zig19
1 files changed, 19 insertions, 0 deletions
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);
+}