mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-06-11 22:28:20 +00:00
zsh: improve ZDOTDIR documentation
The main thing to emphasize is that end users should never source .zshenv directly; it's only meant to be used as part of our shell injection environment. At the moment, there's no way to guard against accidentally use, but we can consider making e.g. GHOSTTY_SHELL_FEATURES always defined in this environment to that it can be used to differentiate the cases. In practice, it's unlikely that people actually source this .zshenv script directly, so hopefully this additional documentation clarifies things well enough.
This commit is contained in:
@@ -659,12 +659,12 @@ fn setupZsh(
|
||||
resource_dir: []const u8,
|
||||
env: *EnvMap,
|
||||
) !void {
|
||||
// Preserve the old zdotdir value so we can recover it.
|
||||
// Preserve an existing ZDOTDIR value. We're about to overwrite it.
|
||||
if (env.get("ZDOTDIR")) |old| {
|
||||
try env.put("GHOSTTY_ZSH_ZDOTDIR", old);
|
||||
}
|
||||
|
||||
// Set our new ZDOTDIR
|
||||
// Set our new ZDOTDIR to point to our shell resource directory.
|
||||
var path_buf: [std.fs.max_path_bytes]u8 = undefined;
|
||||
const integ_dir = try std.fmt.bufPrint(
|
||||
&path_buf,
|
||||
|
||||
Reference in New Issue
Block a user