This allows customization of the arguments used by less. The main
motivation is that some folks might not like having --no-init on every
invocation of less.
this to an empty string or the value
<literal>cat</literal> is equivalent to passing
<option>--no-pager</option>.</para></listitem>
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>
</varlistentry>
</variablelist>
</refsect1>
this to an empty string or the value
<literal>cat</literal> is equivalent to passing
<option>--no-pager</option>.</para></listitem>
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>
</varlistentry>
</variablelist>
</refsect1>
this to an empty string or the value
<literal>cat</literal> is equivalent to passing
<option>--no-pager</option>.</para></listitem>
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>
</varlistentry>
</variablelist>
</refsect1>
this to an empty string or the value
<literal>cat</literal> is equivalent to passing
<option>--no-pager</option>.</para></listitem>
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>
</varlistentry>
</variablelist>
</refsect1>
equivalent to passing
<option>--no-pager</option>.</para>
</listitem>
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>
</varlistentry>
</variablelist>
</refsect1>
equivalent to passing
<option>--no-pager</option>.</para>
</listitem>
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>
</varlistentry>
</variablelist>
</refsect1>
this to an empty string or the value
<literal>cat</literal> is equivalent to passing
<option>--no-pager</option>.</para></listitem>
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>
</varlistentry>
</variablelist>
</refsect1>
/* In the child start the pager */
if (pager_pid == 0) {
/* In the child start the pager */
if (pager_pid == 0) {
dup2(fd[0], STDIN_FILENO);
close_pipe(fd);
dup2(fd[0], STDIN_FILENO);
close_pipe(fd);
+ less_opts = getenv("SYSTEMD_LESS");
+ if (!less_opts)
+ less_opts = "FRSXMK";
- 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)
/* Make sure the pager goes away when the parent dies */
if (prctl(PR_SET_PDEATHSIG, SIGTERM) < 0)