summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--man/journalctl.xml4
-rw-r--r--man/localectl.xml4
-rw-r--r--man/loginctl.xml4
-rw-r--r--man/machinectl.xml4
-rw-r--r--man/systemctl.xml4
-rw-r--r--man/systemd-analyze.xml4
-rw-r--r--man/timedatectl.xml4
-rw-r--r--src/shared/pager.c9
8 files changed, 34 insertions, 3 deletions
diff --git a/man/journalctl.xml b/man/journalctl.xml
index 3b05e80fc1..18a1b9ef2d 100644
--- a/man/journalctl.xml
+++ b/man/journalctl.xml
@@ -887,6 +887,10 @@
this to an empty string or the value
<literal>cat</literal> is equivalent to passing
<option>--no-pager</option>.</para></listitem>
+ <term><varname>$SYSTEMD_LESS</varname></term>
+ <listitem><para><varname>$SYSTEMD_LESS</varname> overrides the
+ default options passed to <literal>less</literal>
+ (<literal>FRSXMK</literal>).</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
diff --git a/man/localectl.xml b/man/localectl.xml
index 0950cce97d..238757c2e5 100644
--- a/man/localectl.xml
+++ b/man/localectl.xml
@@ -265,6 +265,10 @@
this to an empty string or the value
<literal>cat</literal> is equivalent to passing
<option>--no-pager</option>.</para></listitem>
+ <term><varname>$SYSTEMD_LESS</varname></term>
+ <listitem><para><varname>$SYSTEMD_LESS</varname> overrides the
+ default options passed to <literal>less</literal>
+ (<literal>FRSXMK</literal>).</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
diff --git a/man/loginctl.xml b/man/loginctl.xml
index 13105d4dcd..ede869f394 100644
--- a/man/loginctl.xml
+++ b/man/loginctl.xml
@@ -486,6 +486,10 @@
this to an empty string or the value
<literal>cat</literal> is equivalent to passing
<option>--no-pager</option>.</para></listitem>
+ <term><varname>$SYSTEMD_LESS</varname></term>
+ <listitem><para><varname>$SYSTEMD_LESS</varname> overrides the
+ default options passed to <literal>less</literal>
+ (<literal>FRSXMK</literal>).</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
diff --git a/man/machinectl.xml b/man/machinectl.xml
index cabdbac962..2e7fa3bf8d 100644
--- a/man/machinectl.xml
+++ b/man/machinectl.xml
@@ -311,6 +311,10 @@
this to an empty string or the value
<literal>cat</literal> is equivalent to passing
<option>--no-pager</option>.</para></listitem>
+ <term><varname>$SYSTEMD_LESS</varname></term>
+ <listitem><para><varname>$SYSTEMD_LESS</varname> overrides the
+ default options passed to <literal>less</literal>
+ (<literal>FRSXMK</literal>).</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
diff --git a/man/systemctl.xml b/man/systemctl.xml
index ed1bf4813a..1b0f8e5e2d 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -1479,6 +1479,10 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
equivalent to passing
<option>--no-pager</option>.</para>
</listitem>
+ <term><varname>$SYSTEMD_LESS</varname></term>
+ <listitem><para><varname>$SYSTEMD_LESS</varname> overrides the
+ default options passed to <literal>less</literal>
+ (<literal>FRSXMK</literal>).</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
diff --git a/man/systemd-analyze.xml b/man/systemd-analyze.xml
index cbf59e0a1a..54479e4876 100644
--- a/man/systemd-analyze.xml
+++ b/man/systemd-analyze.xml
@@ -335,6 +335,10 @@ $ eog targets.svg</programlisting>
equivalent to passing
<option>--no-pager</option>.</para>
</listitem>
+ <term><varname>$SYSTEMD_LESS</varname></term>
+ <listitem><para><varname>$SYSTEMD_LESS</varname> overrides the
+ default options passed to <literal>less</literal>
+ (<literal>FRSXMK</literal>).</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
diff --git a/man/timedatectl.xml b/man/timedatectl.xml
index beda304854..be66993e15 100644
--- a/man/timedatectl.xml
+++ b/man/timedatectl.xml
@@ -239,6 +239,10 @@
this to an empty string or the value
<literal>cat</literal> is equivalent to passing
<option>--no-pager</option>.</para></listitem>
+ <term><varname>$SYSTEMD_LESS</varname></term>
+ <listitem><para><varname>$SYSTEMD_LESS</varname> overrides the
+ default options passed to <literal>less</literal>
+ (<literal>FRSXMK</literal>).</para></listitem>
</varlistentry>
</variablelist>
</refsect1>
diff --git a/src/shared/pager.c b/src/shared/pager.c
index 72a29f2285..55b13d6ff6 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -84,14 +84,17 @@ int pager_open(bool jump_to_end) {
/* In the child start the pager */
if (pager_pid == 0) {
+ const char* less_opts;
dup2(fd[0], STDIN_FILENO);
close_pipe(fd);
+ less_opts = getenv("SYSTEMD_LESS");
+ if (!less_opts)
+ less_opts = "FRSXMK";
if (jump_to_end)
- setenv("LESS", "FRSXMK+G", 1);
- else
- setenv("LESS", "FRSXMK", 1);
+ less_opts = strappenda(less_opts, " +G");
+ setenv("LESS", less_opts, 1);
/* Make sure the pager goes away when the parent dies */
if (prctl(PR_SET_PDEATHSIG, SIGTERM) < 0)