From b3557640d6a0a4c2c41b6e1cae3c8182a32937ca Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 07:24:46 -0300 Subject: New from a column's exec makes its scratch in the session's directory, as tagexec's does A word run from a header runs in the session's directory (execDir), but New named its scratch after the pane with the keyboard. Co-Authored-By: Claude Opus 5.5 --- src/ninep/cols.zig | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/ninep/cols.zig') diff --git a/src/ninep/cols.zig b/src/ninep/cols.zig index 7745ee5e..b00ecdba 100644 --- a/src/ninep/cols.zig +++ b/src/ninep/cols.zig @@ -177,6 +177,18 @@ pub fn writeExec(p: *Pardes, req: Req, serial: ?u32) Reply { return .{ .tag = req.tag, .written = @intCast(req.data.len) }; } +test "New written to a column's exec makes its scratch in the session's directory, as tagexec's does" { + const p = try th.withFile(testing.allocator, "x\n"); + defer p.deinit(); + const session = "/project/src"; + @memcpy(p.session_dir[0..session.len], session); + p.session_dir_len = session.len; + const serial = layout.columnSerial(p, 0); + const exec_node = tree.Node.ofCol(serial, .exec); + try testing.expectEqual(tree.Status.ok, th.wr(p, exec_node, "New\n").reply.status); + try testing.expectEqualStrings("/project/src/+New", p.panes[p.active].?.file.?.path); +} + /// rmdir of a column closes it when it is empty; one with panes is /// refused, saying so (close them, or Delcol on its ctl, which asks first). pub fn remove(p: *Pardes, req: Req, serial: u32, file: tree.ColFile) Reply { -- cgit v1.3