From 80ed1bf997117a36b9d0e10744de736e84d96e7f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 03:04:42 -0300 Subject: Shell refuses a name that is no executable, and bare restores the default Shell took any word and the host quietly ran another shell at the next spawn. It now refuses a path or name that is not executable ("Shell: x: no executable by that name", failing a ctl write, logged err), a bare Shell goes back to the default, and a default $SHELL that is not executable falls back to /bin/sh. shellset's golden takes the refusal on the message row (re-recorded by name). Co-Authored-By: Claude Opus 5.5 --- src/config.zig | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/config.zig') 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 => { -- cgit v1.3