diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-30 12:03:44 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | d6c877f55669869bc4c360e6d94563ded778d26d (patch) | |
| tree | c9c8ec537b97445c60936135b359d03434c669d6 /src/ninep | |
| parent | 946e7c6c00c1ecc20c1e529608423ac9caa6c6ba (diff) | |
| download | pardes-d6c877f55669869bc4c360e6d94563ded778d26d.tar.gz pardes-d6c877f55669869bc4c360e6d94563ded778d26d.zip | |
Help and Find from the workspace or a column tag act in the session's directory, not the keyboard pane's
New, Tty and commands clicked in a tag no pane owns ran in the session's
directory, but Help named its +Help after the pane with the keyboard, and
Find walked that pane's directory. So the same click gave different
results depending on which pane was focused. Both now take the session's
directory from a header, through execDir as the others do.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep')
| -rw-r--r-- | src/ninep/cols.zig | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ninep/cols.zig b/src/ninep/cols.zig index 1919122d..454cce4a 100644 --- a/src/ninep/cols.zig +++ b/src/ninep/cols.zig @@ -283,6 +283,24 @@ test "a pane's word written to /tagexec or a column's exec is refused, and acts try testing.expectEqual(tree.Status.ok, th.wr(p, col_exec, "New\n").reply.status); } +test "Help and Find at /tagexec act in the session's directory, not the keyboard pane's" { + const p = try th.withFile(testing.allocator, "x\n"); + defer p.deinit(); + var tmp = testing.tmpDir(.{}); + defer tmp.cleanup(); + try tmp.dir.writeFile(testing.io, .{ .sub_path = "needle.txt", .data = "n\n" }); + var buf: [4096]u8 = undefined; + const session = buf[0..try tmp.dir.realPath(testing.io, &buf)]; + @memcpy(p.session_dir[0..session.len], session); + p.session_dir_len = @intCast(session.len); + const tagexec = @intFromEnum(tree.TopFile.tagexec); + for ([_][]const u8{ "Help\n", "Find needle\n" }) |line| { + try testing.expectEqual(tree.Status.ok, th.wr(p, tagexec, line).reply.status); + const made = p.panes[p.active].?.file.?.path; + try testing.expectEqualStrings(session, std.fs.path.dirname(made).?); + } +} + test "New and Tty run at /tagexec and a column's exec, with no pane at all too" { const p = try th.withFile(testing.allocator, "x\n"); defer p.deinit(); |
