summaryrefslogtreecommitdiff
path: root/src/config.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.zig')
-rw-r--r--src/config.zig8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/config.zig b/src/config.zig
index a59fe18d..e0fcab48 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -350,7 +350,8 @@ test "wheel drift guard" {
pub fn defaultShell() []const u8 {
if (comptime pardes.hosted) if (std.c.getenv("SHELL")) |s| {
const shell = std.mem.span(s);
- if (shell.len > 0) return shell;
+ // One that is not there, or not executable, is no shell: /bin/sh.
+ if (shell.len > 0 and std.c.access(s, std.c.X_OK) == 0) return shell;
};
return "/bin/sh";
}
@@ -1045,8 +1046,9 @@ pub const Runtime = struct {
}
},
.shell => {
- const value = std.mem.trim(u8, argument orelse return false, " \t\r\n");
- if (value.len == 0 or !state.shell.requested.set(value)) return false;
+ // Bare, the default again ($SHELL, else /bin/sh).
+ const value = std.mem.trim(u8, argument orelse "", " \t\r\n");
+ if (!state.shell.requested.set(value)) return false;
state.shell.pending = true;
},
.tagline_size => {