diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 03:37:13 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 98e94b86a7c38e2bf4d66e57144fc9329906bb3b (patch) | |
| tree | 61a7c596cd54dbc4d7a0b17243f592b2fb4bab80 /src/builtins.zig | |
| parent | d067c77813f9ce9fcc64b33e6b0284510ac02185 (diff) | |
| download | pardes-98e94b86a7c38e2bf4d66e57144fc9329906bb3b.tar.gz pardes-98e94b86a7c38e2bf4d66e57144fc9329906bb3b.zip | |
Tty and Shell refuse a directory: not a shell
A directory passes access(X_OK), so Tty /etc made a pane whose shell
exited 127 and Shell /etc was taken. The shell lookup now refuses a
directory, and both say "not a shell: /etc is a directory" (Tty and
Shell share one refusal, host_io.Shell.refusal). shellset's golden takes
the shared wording (re-recorded by name).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/builtins.zig')
| -rw-r--r-- | src/builtins.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/builtins.zig b/src/builtins.zig index f7dd543a..87a4d022 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -1020,10 +1020,10 @@ pub const Tty = struct { // A shell that is not there is said, where the host would quietly // start its fallback in its place. if (comptime pardes.hosted) if (arg.len > 0) { - var buf: [std.fs.max_path_bytes]u8 = undefined; - if (@import("host_io.zig").Shell.find(arg, &buf) == null) { - var said: [320]u8 = undefined; - return c.p.reportFailure(c.id, std.fmt.bufPrint(&said, "Tty: no shell \"{s}\" (a name on the usual paths, or a path to one)", .{arg[0..@min(arg.len, 200)]}) catch "Tty: no such shell"); + var why: [320]u8 = undefined; + if (@import("host_io.zig").Shell.refusal(arg[0..@min(arg.len, 200)], &why)) |refused| { + var said: [340]u8 = undefined; + return c.p.reportFailure(c.id, std.fmt.bufPrint(&said, "Tty: {s}", .{refused}) catch "Tty: no such shell"); } }; const pane = exec.spawnTty(c.p, c.id) orelse return; |
