diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 02:23:59 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 45a66bd1c062a5cf4d63b1df68e050b059cdfa1d (patch) | |
| tree | 3c6ecbd21dd2d07c624b8799defc31d94d51a256 /test | |
| parent | 90f5c414a90afec978c8c0add58fd2a7e29acbaa (diff) | |
| download | pardes-45a66bd1c062a5cf4d63b1df68e050b059cdfa1d.tar.gz pardes-45a66bd1c062a5cf4d63b1df68e050b059cdfa1d.zip | |
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 <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/macos_e2e.swift | 2 | ||||
| -rw-r--r-- | test/output.zig | 3 | ||||
| -rw-r--r-- | test/snapshot.zig | 5 | ||||
| -rw-r--r-- | test/snapshots/shellset.snap | 4 |
4 files changed, 8 insertions, 6 deletions
diff --git a/test/macos_e2e.swift b/test/macos_e2e.swift index 5f172f9d..2b0eedad 100644 --- a/test/macos_e2e.swift +++ b/test/macos_e2e.swift @@ -1251,7 +1251,7 @@ private func buildWorld(stem: String) throws -> String { // sources $HOME/.bashrc (host_io.Shell) — so this is what pins the // prompt to `$ ` and keeps the developer's history out of the capture. try "PS1='$ '\nHISTFILE=\n".write(toFile: "\(home)/.bashrc", atomically: true, encoding: .utf8) - // ...and the config is not empty, because the DEFAULT shell is fish, whose + // ...and the config is not empty, because the DEFAULT shell is $SHELL (fish, say), whose // prompt carries a hostname and whose greeting carries a version. A golden // taken against that is a golden for one machine. try "Shell bash\n".write(toFile: "\(pardesConfig)/init", atomically: true, encoding: .utf8) diff --git a/test/output.zig b/test/output.zig index 419bcca2..f3e61e93 100644 --- a/test/output.zig +++ b/test/output.zig @@ -544,10 +544,11 @@ test "Config prints the startup path and refreshes its one output" { for ([_][]const u8{ "Startup config: " ++ path ++ "\n", "Theme orchard\n", - "Shell requested (new panes) " ++ config.default_shell ++ " (default)\n", "Shell effective (last spawn) (none)\n", "Shell pending on\n", }) |line| try std.testing.expect(std.mem.indexOf(u8, out.content, line) != null); + var default_line: [256]u8 = undefined; + try std.testing.expect(std.mem.indexOf(u8, out.content, try std.fmt.bufPrint(&default_line, "Shell requested (new panes) {s} (default)\n", .{config.defaultShell()})) != null); try std.testing.expectEqualStrings(config.config_buffer, std.fs.path.basename(out.path)); try std.testing.expectEqual(panes.Output.Origin{ .cmd = .Config }, out.output.?.from); diff --git a/test/snapshot.zig b/test/snapshot.zig index 2fa8e89c..c49e7645 100644 --- a/test/snapshot.zig +++ b/test/snapshot.zig @@ -562,8 +562,9 @@ fn runScript(arena: std.mem.Allocator, exe_z: [:0]const u8, script_path: []const // XDG directory that points outside this per-snapshot fake home. const config_home = try std.fmt.allocPrintSentinel(arena, "{s}/.config", .{home}, 0); _ = setenv("XDG_CONFIG_HOME", config_home, 1); - // ...and it is not empty: the DEFAULT shell is fish, whose prompt carries - // a hostname and whose greeting carries a version, so a golden taken + // ...and it is not empty: the DEFAULT shell is $SHELL, whatever this + // machine's user logs in with (fish's prompt carries a hostname and its + // greeting a version), so a golden taken // against it would be a golden for this machine. Every script here runs // bash — the .bashrc above pins its prompt to `$ ` — and the fish path is // covered by host_io.Shell's unit tests instead. This is an ordinary diff --git a/test/snapshots/shellset.snap b/test/snapshots/shellset.snap index d2bacf38..ef8b02b9 100644 --- a/test/snapshots/shellset.snap +++ b/test/snapshots/shellset.snap @@ -2,8 +2,8 @@ # here is the case that has to hold on a machine you did not set up: the name # resolves to nothing, and the pane opens anyway. # -# That is not a corner — it is the DEFAULT's failure mode. pardes ships -# `Shell fish` as the default, and a box without fish must still get a working +# That is not a corner — it is the DEFAULT's failure mode. pardes defaults +# to $SHELL, which may name a shell the box lacks, and it must still get a working # shell rather than a pane whose child dies at exec and shows one EOF. So the # lookup falls back, and this is the proof: a name nothing resolves to, and the # new pane still greets and lists like any other. |
