man: Skip shellrc when invoking pager using sh

man invokes the pager command via `sh` which, since
beaae6b420 launches `Shell` in posix mode.
As the referenced commits message indicates, launching `Shell` in posix
mode while interactive, makes it choke on the default `.shellrc`. This
made `man` spew out some shell syntax errors to stderr every time it
invoked the pager.

To fix that, invoke `sh` with `--skip-shellrc` for now as suggested by
the aforementioned commit.
This commit is contained in:
Mathis Wiehl 2023-03-06 19:46:51 +01:00 committed by Andreas Kling
parent d1371d66f7
commit 98ee2fcd1b
Notes: sideshowbarker 2024-07-17 16:23:06 +09:00

View file

@ -23,7 +23,7 @@
static ErrorOr<pid_t> pipe_to_pager(DeprecatedString const& command)
{
char const* argv[] = { "sh", "-c", command.characters(), nullptr };
char const* argv[] = { "sh", "--skip-shellrc", "-c", command.characters(), nullptr };
auto stdout_pipe = TRY(Core::System::pipe2(O_CLOEXEC));