diff options
Diffstat (limited to 'src/libmain/shared.cc')
-rw-r--r-- | src/libmain/shared.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index 263e1744c089..5a740367ca12 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -305,13 +305,14 @@ RunPager::RunPager() pid = startProcess([&]() { if (dup2(toPager.readSide, STDIN_FILENO) == -1) throw SysError("dupping stdin"); + if (!getenv("LESS")) + setenv("LESS", "FRSXMK", 1); execl("/bin/sh", "sh", "-c", pager.c_str(), NULL); throw SysError(format("executing ‘%1%’") % pager); }); if (dup2(toPager.writeSide, STDOUT_FILENO) == -1) throw SysError("dupping stdout"); - } |