summaryrefslogtreecommitdiff
path: root/test/snapshot.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/snapshot.zig')
-rw-r--r--test/snapshot.zig4
1 files changed, 4 insertions, 0 deletions
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