summaryrefslogtreecommitdiff
path: root/src/ninep/cols.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 11:35:25 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commit85728b391a0137f9c2b63c3234364b1f81f6be78 (patch)
tree8a662845628d679cd383d925f40f66911588d7fa /src/ninep/cols.zig
parent5e8d2b7ac7d7880ac36ec45484b2711669ac7ae1 (diff)
downloadpardes-85728b391a0137f9c2b63c3234364b1f81f6be78.tar.gz
pardes-85728b391a0137f9c2b63c3234364b1f81f6be78.zip
A word at /tagexec or a column's exec that makes, acts on and focuses no pane reads back nothing
Newcol written to /tagexec read back `1`, the pane with the keyboard, which the word never touched. That was a pane word's fallback (a pane's exec answers the pane it ran at) applied to a tag no pane owns. A word in a column's or the workspace's tag now answers the pane it made, refilled, went to or focused, and otherwise nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/cols.zig')
-rw-r--r--src/ninep/cols.zig13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ninep/cols.zig b/src/ninep/cols.zig
index c049e0f3..b1ca954c 100644
--- a/src/ninep/cols.zig
+++ b/src/ninep/cols.zig
@@ -227,6 +227,19 @@ test "New written to a column's exec makes its scratch in the session's director
try testing.expectEqualStrings("/project/src/+New", p.panes[p.active].?.file.?.path);
}
+test "a tagexec word that makes, acts on and focuses no pane reads back nothing" {
+ const p = try th.withFile(testing.allocator, "x\n");
+ defer p.deinit();
+ const tagexec = @intFromEnum(tree.TopFile.tagexec);
+ try testing.expectEqual(tree.Status.ok, th.wr(p, tagexec, "Newcol\n").reply.status);
+ try testing.expectEqualStrings("", th.rd(p, tagexec, 0, 64).bytes);
+ // A column's New makes one, and answers it.
+ const col_exec = tree.Node.ofCol(layout.columnSerial(p, 0), .exec);
+ try testing.expectEqual(tree.Status.ok, th.wr(p, col_exec, "New\n").reply.status);
+ var want: [16]u8 = undefined;
+ try testing.expectEqualStrings(try std.fmt.bufPrint(&want, "{d}\n", .{p.panes[p.active].?.serial}), th.rd(p, col_exec, 0, 64).bytes);
+}
+
test "New written to a column's ctl reads back the new pane alone, as its exec does" {
const p = try th.withFile(testing.allocator, "x\n");
defer p.deinit();