summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 03:37:13 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit98e94b86a7c38e2bf4d66e57144fc9329906bb3b (patch)
tree61a7c596cd54dbc4d7a0b17243f592b2fb4bab80 /src/exec.zig
parentd067c77813f9ce9fcc64b33e6b0284510ac02185 (diff)
downloadpardes-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/exec.zig')
-rw-r--r--src/exec.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/exec.zig b/src/exec.zig
index 963c8763..ddb89d33 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -776,10 +776,10 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[]
return;
}
if (comptime pardes.hosted) {
- var buf: [std.fs.max_path_bytes]u8 = undefined;
- if (@import("host_io.zig").Shell.find(want, &buf) == null) {
- var text: [320]u8 = undefined;
- return p.reportFailure(p.active, std.fmt.bufPrint(&text, "Shell: {s}: no executable by that name", .{want[0..@min(want.len, 255)]}) catch "Shell: no such executable");
+ var why: [320]u8 = undefined;
+ if (@import("host_io.zig").Shell.refusal(want[0..@min(want.len, 200)], &why)) |refused| {
+ var text: [340]u8 = undefined;
+ return p.reportFailure(p.active, std.fmt.bufPrint(&text, "Shell: {s}", .{refused}) catch "Shell: no such shell");
}
}
if (!p.settings.apply(setting, want) and p.announce) p.reportFailure(p.active, "Shell: does not take that value");