mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-16 23:06:20 +00:00
fix: instead of overriding MANPATHs set by OS, append to them
Quoting `man man`: > If MANPATH begins with a colon, it is appended to the default list; Alternatively we can think about: > if it ends with a colon, it is prepended to the default list; To take preference over existing values, but that shouldn't be really a problem, as there rather isn't much of another projects named `ghostty`.
This commit is contained in:
@@ -648,17 +648,14 @@ const Subprocess = struct {
|
||||
break :man;
|
||||
};
|
||||
|
||||
if (env.get("MANPATH")) |manpath| {
|
||||
// Append to the existing MANPATH. It's very unlikely that our bundle's
|
||||
// resources directory already appears here so we don't spend the time
|
||||
// searching for it.
|
||||
try env.put(
|
||||
"MANPATH",
|
||||
try internal_os.appendEnv(alloc, manpath, dir),
|
||||
);
|
||||
} else {
|
||||
try env.put("MANPATH", dir);
|
||||
}
|
||||
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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user