From 35cecf26b06cf50d9827056da99d883ca975c39b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 2 Aug 2026 18:17:37 -0300 Subject: load builtin commands from the user config before rendering --- test/snapshot.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/snapshot.zig') diff --git a/test/snapshot.zig b/test/snapshot.zig index 19b65a02..7c00b97c 100644 --- a/test/snapshot.zig +++ b/test/snapshot.zig @@ -307,6 +307,10 @@ fn runScript(arena: std.mem.Allocator, exe_z: [:0]const u8, script_path: []const // deterministic shell: fixed prompt, no history, no user rc leakage try eh.writeFile(try std.fmt.allocPrintSentinel(arena, "{s}/.bashrc", .{home}, 0), "PS1='$ '\nHISTFILE=\n"); _ = setenv("HOME", try arena.dupeZ(u8, home), 1); + // Keep startup configuration hermetic even when the developer exports an + // 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); _ = setenv("TERM", "xterm-256color", 1); _ = setenv("LC_ALL", "C", 1); // durations cannot live in a golden; the lsp introspection views print -- cgit v1.3