diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-08-28 00:13:34 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-03-29 10:45:08 +0200 |
commit | 1e8d75e46d3c1633e8c5a290677bf64ccd06195e (patch) | |
tree | f0a0d8282f3a5e2332eb9b582dedd8f25505d369 | |
parent | e42398b28a4d24b716484cffb2afedf0db55ee98 (diff) |
pager: also redirect stderr
It's really confusing if stdout goes to the pager, but stderr is written
directly to the screen. Hence, make sure both stdout and stderr are
passed to the pager when doing autopaging.
-rw-r--r-- | src/shared/pager.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/shared/pager.c b/src/shared/pager.c index f1f3dc7e7..7721e29ff 100644 --- a/src/shared/pager.c +++ b/src/shared/pager.c @@ -82,7 +82,7 @@ int pager_open(bool jump_to_end) { /* In the child start the pager */ if (pager_pid == 0) { - const char* less_opts, *less_charset; + const char* less_opts; (void) reset_all_signal_handlers(); (void) reset_signal_mask(); @@ -90,7 +90,6 @@ int pager_open(bool jump_to_end) { dup2(fd[0], STDIN_FILENO); safe_close_pair(fd); - /* Initialize a good set of less options */ less_opts = getenv("SYSTEMD_LESS"); if (!less_opts) less_opts = "FRSXMK"; @@ -98,15 +97,6 @@ int pager_open(bool jump_to_end) { less_opts = strjoina(less_opts, " +G"); setenv("LESS", less_opts, 1); - /* Initialize a good charset for less. This is - * particularly important if we output UTF-8 - * characters. */ - less_charset = getenv("SYSTEMD_LESSCHARSET"); - if (!less_charset && is_locale_utf8()) - less_charset = "utf-8"; - if (less_charset) - setenv("LESSCHARSET", less_charset, 1); - /* Make sure the pager goes away when the parent dies */ if (prctl(PR_SET_PDEATHSIG, SIGTERM) < 0) _exit(EXIT_FAILURE); |