From 60367d8fe23f6af98ec28e3cf6c2094dfe332df0 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 6 Sep 2026 18:11:36 -0300 Subject: Refactor panes and filesystem; replace FUSE with 9P Consolidate pane, layout, memory and host code. Serve 9P by default over Unix sockets, with runtime mounts and optional TCP/QUIC transports. Remove FUSE and obsolete proof-of-concept examples. Fix highlighting and terminal-history performance, expand differential and stress-test infrastructure, sort navigation results while preserving the next occurrence, add syntax-colored Braille minimaps, remove SPC-k, and document 9P interaction as a repository skill. --- src/selection_pipe.zig | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/selection_pipe.zig') diff --git a/src/selection_pipe.zig b/src/selection_pipe.zig index 8e721751..e1a42962 100644 --- a/src/selection_pipe.zig +++ b/src/selection_pipe.zig @@ -4,6 +4,7 @@ //! `runOne` on that worker. No subprocess or borrowed core memory reaches the //! editor/event-loop thread. const std = @import("std"); +const filesystem = @import("fs.zig"); /// A deliberately finite answer. One selection cannot retain more than 1 MiB /// and a multi-selection command cannot retain more than 4 MiB in total. @@ -43,7 +44,7 @@ pub const Job = struct { .inputs = &.{}, }; errdefer gpa.free(job.command); - job.cwd = try gpa.dupe(u8, request.cwd); + job.cwd = try gpa.dupe(u8, filesystem.localPath(request.cwd) orelse request.cwd); errdefer gpa.free(job.cwd); job.inputs = try gpa.alloc([]u8, request.inputs.len); errdefer gpa.free(job.inputs); @@ -325,6 +326,29 @@ pub fn runJob(gpa: std.mem.Allocator, io: std.Io, job: *const Job) Response { return response; } +test "native selection filters use the physical directory of an explicit OS mount" { + const gpa = std.testing.allocator; + var tmp = std.testing.tmpDir(.{}); + defer tmp.cleanup(); + var directory_buf: [4096]u8 = undefined; + const directory = directory_buf[0..try tmp.dir.realPath(std.testing.io, &directory_buf)]; + var declared_buf: [4102]u8 = undefined; + const declared = try std.fmt.bufPrint(&declared_buf, "/n/os{s}", .{directory}); + const job = try Job.copy(gpa, .{ .id = 1, .command = "pwd", .cwd = declared, .inputs = &.{.{ .bytes = "" }} }); + defer job.deinit(gpa); + try std.testing.expectEqualStrings(directory, job.cwd); + switch (runOne(gpa, std.testing.io, job.command, job.cwd, "")) { + .ok => |bytes| { + defer gpa.free(bytes); + try std.testing.expectEqualStrings(directory, std.mem.trimEnd(u8, bytes, "\n")); + }, + .failed => |failure| { + gpa.free(failure.stderr); + return error.FilterFailed; + }, + } +} + test "native pipe runner preserves stdin/stdout bytes and reports how it failed" { const gpa = std.testing.allocator; const io = std.testing.io; -- cgit v1.3