mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 00:06:09 +03:00
tweaks
This commit is contained in:
@ -24,6 +24,9 @@ pub fn appendEnv(
|
||||
}
|
||||
|
||||
/// Always append value to environment, even when it is empty.
|
||||
/// This is useful because some env vars (like MANPATH) want there
|
||||
/// to be an empty prefix to preserve existing values.
|
||||
///
|
||||
/// The returned value is always allocated so it must be freed.
|
||||
pub fn appendEnvAlways(
|
||||
alloc: Allocator,
|
||||
|
@ -648,13 +648,16 @@ const Subprocess = struct {
|
||||
break :man;
|
||||
};
|
||||
|
||||
const manpath = env.get("MANPATH") orelse "";
|
||||
// Always append with colon in front, as it mean that if
|
||||
// `MANPATH` is empty, then it should be treated as an extra
|
||||
// path instead of overriding all paths set by OS.
|
||||
try env.put(
|
||||
"MANPATH",
|
||||
try internal_os.appendEnvAlways(alloc, manpath, dir),
|
||||
try internal_os.appendEnvAlways(
|
||||
alloc,
|
||||
env.get("MATHPATH") orelse "",
|
||||
dir,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user