From c4bc85b8da17ae2a191d0c73424e17fde8b6391e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 08:32:20 -0300 Subject: A look of `./x` that is not there is a miss, as `x` and `/abs/x` are: the write answered, the err logged, not ENOENT `./x` and `../x` failed their write with ENOENT while every other name that opens nothing was a miss the write was still answered with. They are misses now too, said and logged `look: ./x: no such file`. A pane's own directory gone stays a failure. Co-Authored-By: Claude Opus 5.5 --- src/look.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/look.zig') diff --git a/src/look.zig b/src/look.zig index 0f5103ba..19b320f9 100644 --- a/src/look.zig +++ b/src/look.zig @@ -1401,8 +1401,10 @@ fn lookUnresolved(p: *Pardes, id: usize, pane: *Pane, trimmed: []const u8, text: var said: [4200]u8 = undefined; const gone = if (comptime pardes.hosted) if (filesystem.localPath(dir)) |local| !exec.isDirectory(local) else false else true; if (gone) return p.reportFailure(id, std.fmt.bufPrint(&said, "look: {s}: no such directory", .{dir[0..@min(dir.len, 4096)]}) catch "look: no such directory"); + // A file not there is a miss, as `x` and `/abs/x` are: said and + // logged, the write answered with nothing. var cut: [miss_path_cap + "…".len]u8 = undefined; - return p.reportFailure(id, std.fmt.bufPrint(&said, "look: {s}: no such file", .{missText(trimmed, &cut)}) catch "look: no such file"); + return missed(p, id, "{s}: no such file", .{missText(trimmed, &cut)}); } // A raw terminal's clicks are its program's; a look written over // 9P is no keyboard input, and searches whatever the key mode. -- cgit v1.3