mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Don't override default man search paths
By appending a colon to MANPATH NIX_MAN_DIR gets prepended to the final MANPATH before default search paths. This makes man still consider default search paths, but prefers NIX_MAN_DIR (if it exists). It still makes sense to point NIX_MAN_DIR to a correct location by moving man pages build from nix-manual.man to nix-cli.man, but this should fix most common use-cases where nix is installed globally.
This commit is contained in:
parent
9427c028ec
commit
95f16a3275
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ std::filesystem::path getNixManDir()
|
|||
void showManPage(const std::string & name)
|
||||
{
|
||||
restoreProcessContext();
|
||||
setEnv("MANPATH", getNixManDir().c_str());
|
||||
setEnv("MANPATH", (getNixManDir().string() + ":").c_str());
|
||||
execlp("man", "man", name.c_str(), nullptr);
|
||||
if (errno == ENOENT) {
|
||||
// Not SysError because we don't want to suffix the errno, aka No such file or directory.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue