mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +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.
|
/// 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.
|
/// The returned value is always allocated so it must be freed.
|
||||||
pub fn appendEnvAlways(
|
pub fn appendEnvAlways(
|
||||||
alloc: Allocator,
|
alloc: Allocator,
|
||||||
|
@ -648,13 +648,16 @@ const Subprocess = struct {
|
|||||||
break :man;
|
break :man;
|
||||||
};
|
};
|
||||||
|
|
||||||
const manpath = env.get("MANPATH") orelse "";
|
|
||||||
// Always append with colon in front, as it mean that if
|
// Always append with colon in front, as it mean that if
|
||||||
// `MANPATH` is empty, then it should be treated as an extra
|
// `MANPATH` is empty, then it should be treated as an extra
|
||||||
// path instead of overriding all paths set by OS.
|
// path instead of overriding all paths set by OS.
|
||||||
try env.put(
|
try env.put(
|
||||||
"MANPATH",
|
"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