From 399d005f1997f23d50f36829946f2d5d7a98b928 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 06:18:15 -0300 Subject: A pane from pane/new is the session's directory's scratch, not the last active pane's No pane asked for it, so borrowing the directory of whichever pane last had the keyboard named it after an accident; acme's new window has acme's directory. Co-Authored-By: Claude Opus 5.5 --- src/ninep/pane.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/ninep/pane.zig') diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig index 899d8528..61642999 100644 --- a/src/ninep/pane.zig +++ b/src/ninep/pane.zig @@ -1143,11 +1143,15 @@ test "relative names use the file directory and can name a new target" { try testing.expect(dirtyOf(pane)); } -test "relative names follow inherited scratch and virtual directories" { +test "relative names follow a pane/new scratch's session directory and virtual directories" { const p = try withFile(testing.allocator, "source body\n"); defer p.deinit(); const source = p.panes[0].?; - try testing.expectEqual(Status.ok, wr(p, Node.of(source.serial, .name), "/project/src/source.zig\n").reply.status); + try testing.expectEqual(Status.ok, wr(p, Node.of(source.serial, .name), "/elsewhere/source.zig\n").reply.status); + // pane/new's scratch is the session's, not the active pane's. + const session = "/project/src"; + @memcpy(p.session_dir[0..session.len], session); + p.session_dir_len = session.len; const serial = try th.newPane(p); const scratch = p.panes[p.paneBySerial(serial).?].?; const name = Node.of(serial, .name); -- cgit v1.3