From 45a66bd1c062a5cf4d63b1df68e050b059cdfa1d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 02:23:59 -0300 Subject: The default Shell is $SHELL, else /bin/sh With no Shell set, pardes ran fish, which a box may not have and a user may not use. The default is now the user's login shell ($SHELL), else /bin/sh; an explicit Shell still overrides it. The tests pin their own shell (snapshots bash, the python suites /bin/sh or bash) and pass with SHELL unset; the Config report and docs say where the default comes from. Co-Authored-By: Claude Opus 5.5 --- src/config.zig | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/config.zig') diff --git a/src/config.zig b/src/config.zig index fb38e4dd..a59fe18d 100644 --- a/src/config.zig +++ b/src/config.zig @@ -345,7 +345,15 @@ test "wheel drift guard" { try std.testing.expect(wheelTick(&g, false)); } -pub const default_shell = "fish"; +/// The shell when no `Shell` is set: the user's login shell ($SHELL), as a +/// terminal would start, else /bin/sh. An explicit `Shell` overrides it. +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; + }; + return "/bin/sh"; +} // Minimum file gutter width, including the space after the line number. pub const PREFIX_W: u16 = 5; @@ -1364,7 +1372,7 @@ pub const Runtime = struct { try out.writeAll("Startup config: no per-user config path\n"); try out.print( "Platform: {s}\n" ++ - "Compiled default shell: {s}\n", + "Default shell ($SHELL, else /bin/sh): {s}\n", .{ context.platform, context.compiled_default_shell }, ); if (context.gui_shader_source_mode) |mode| @@ -1719,7 +1727,7 @@ pub const Runtime = struct { "TaglineSize 82\n", "Startup config: /tmp/pardes/init\n", "Platform: gui\n", - "Compiled default shell: /bin/sh\n", + "Default shell ($SHELL, else /bin/sh): /bin/sh\n", "GUI shader source: live GLSL compiled during this build\n", "Look hover delay: 18 frames\n", "Native images: on\n", -- cgit v1.3