summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 08:32:20 -0300
committerGabriel Schneider <[email protected]>2026-10-01 08:53:11 -0300
commitc4bc85b8da17ae2a191d0c73424e17fde8b6391e (patch)
tree82c3d3fb35d736123d01b1271224c2484f15a7a1 /src/look.zig
parentb7eb31674e01c992cafc91518e161258b921bd33 (diff)
downloadpardes-c4bc85b8da17ae2a191d0c73424e17fde8b6391e.tar.gz
pardes-c4bc85b8da17ae2a191d0c73424e17fde8b6391e.zip
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 <[email protected]>
Diffstat (limited to 'src/look.zig')
-rw-r--r--src/look.zig4
1 files changed, 3 insertions, 1 deletions
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.