]>
Commit | Line | Data |
---|---|---|
21ac6ff1 | 1 | <?xml version="1.0"?> |
3a54a157 ZJS |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> | |
db9ecf05 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
f48f7543 | 5 | |
21ac6ff1 | 6 | <refsect1> |
6e16066e LP |
7 | <title>Environment</title> |
8 | ||
9 | <variablelist class='environment-variables'> | |
10 | <varlistentry id='pager'> | |
11 | <term><varname>$SYSTEMD_PAGER</varname></term> | |
12 | ||
13 | <listitem><para>Pager to use when <option>--no-pager</option> is not given; overrides | |
14 | <varname>$PAGER</varname>. If neither <varname>$SYSTEMD_PAGER</varname> nor <varname>$PAGER</varname> are set, a | |
15 | set of well-known pager implementations are tried in turn, including | |
98e9d710 ZJS |
16 | <citerefentry project='man-pages'><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry> and |
17 | <citerefentry project='man-pages'><refentrytitle>more</refentrytitle><manvolnum>1</manvolnum></citerefentry>, until one is found. If | |
6e16066e LP |
18 | no pager implementation is discovered no pager is invoked. Setting this environment variable to an empty string |
19 | or the value <literal>cat</literal> is equivalent to passing <option>--no-pager</option>.</para></listitem> | |
20 | </varlistentry> | |
21 | ||
22 | <varlistentry id='less'> | |
23 | <term><varname>$SYSTEMD_LESS</varname></term> | |
24 | ||
25 | <listitem><para>Override the options passed to <command>less</command> (by default | |
6432da6a ZJS |
26 | <literal>FRSXMK</literal>).</para> |
27 | ||
03909b1e ZJS |
28 | <para>Users might want to change two options in particular:</para> |
29 | ||
f8b68539 | 30 | <variablelist> |
03909b1e ZJS |
31 | <varlistentry> |
32 | <term><option>K</option></term> | |
33 | ||
34 | <para>This option instructs the pager to exit immediately when | |
35 | <keycombo><keycap>Ctrl</keycap><keycap>C</keycap></keycombo> is pressed. To allow | |
36 | <command>less</command> to handle <keycombo><keycap>Ctrl</keycap><keycap>C</keycap></keycombo> | |
37 | itself to switch back to the pager command prompt, unset this option.</para> | |
38 | ||
39 | <para>If the value of <varname>$SYSTEMD_LESS</varname> does not include <literal>K</literal>, | |
40 | and the pager that is invoked is <command>less</command>, | |
41 | <keycombo><keycap>Ctrl</keycap><keycap>C</keycap></keycombo> will be ignored by the | |
42 | executable, and needs to be handled by the pager.</para> | |
43 | </varlistentry> | |
44 | ||
45 | <varlistentry> | |
46 | <term><option>X</option></term> | |
47 | ||
48 | <para>This option instructs the pager to not send termcap initialization and deinitialization | |
49 | strings to the terminal. It is set by default to allow command output to remain visible in the | |
50 | terminal even after the pager exits. Nevertheless, this prevents some pager functionality from | |
51 | working, in particular paged output cannot be scrolled with the mouse.</para> | |
52 | </varlistentry> | |
53 | </variablelist> | |
54 | ||
55 | <para>See | |
56 | <citerefentry project='man-pages'><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
57 | for more discussion.</para></listitem> | |
6e16066e LP |
58 | </varlistentry> |
59 | ||
60 | <varlistentry id='lesscharset'> | |
61 | <term><varname>$SYSTEMD_LESSCHARSET</varname></term> | |
62 | ||
63 | <listitem><para>Override the charset passed to <command>less</command> (by default <literal>utf-8</literal>, if | |
64 | the invoking terminal is determined to be UTF-8 compatible).</para></listitem> | |
65 | </varlistentry> | |
66 | ||
612ebf6c | 67 | <varlistentry id='lesssecure'> |
0a42426d ZJS |
68 | <term><varname>$SYSTEMD_PAGERSECURE</varname></term> |
69 | ||
70 | <listitem><para>Takes a boolean argument. When true, the "secure" mode of the pager is enabled; if | |
71 | false, disabled. If <varname>$SYSTEMD_PAGERSECURE</varname> is not set at all, secure mode is enabled | |
72 | if the effective UID is not the same as the owner of the login session, see <citerefentry | |
73 | project='man-pages'><refentrytitle>geteuid</refentrytitle><manvolnum>2</manvolnum></citerefentry> and | |
74 | <citerefentry><refentrytitle>sd_pid_get_owner_uid</refentrytitle><manvolnum>3</manvolnum></citerefentry>. | |
75 | In secure mode, <option>LESSSECURE=1</option> will be set when invoking the pager, and the pager shall | |
76 | disable commands that open or create new files or start new subprocesses. When | |
77 | <varname>$SYSTEMD_PAGERSECURE</varname> is not set at all, pagers which are not known to implement | |
78 | secure mode will not be used. (Currently only | |
79 | <citerefentry><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry> implements | |
80 | secure mode.)</para> | |
81 | ||
82 | <para>Note: when commands are invoked with elevated privileges, for example under <citerefentry | |
83 | project='man-pages'><refentrytitle>sudo</refentrytitle><manvolnum>8</manvolnum></citerefentry> or | |
84 | <citerefentry | |
85 | project='die-net'><refentrytitle>pkexec</refentrytitle><manvolnum>1</manvolnum></citerefentry>, care | |
86 | must be taken to ensure that unintended interactive features are not enabled. "Secure" mode for the | |
87 | pager may be enabled automatically as describe above. Setting <varname>SYSTEMD_PAGERSECURE=0</varname> | |
88 | or not removing it from the inherited environment allows the user to invoke arbitrary commands. Note | |
89 | that if the <varname>$SYSTEMD_PAGER</varname> or <varname>$PAGER</varname> variables are to be | |
377a9545 | 90 | honoured, <varname>$SYSTEMD_PAGERSECURE</varname> must be set too. It might be reasonable to completely |
0a42426d | 91 | disable the pager using <option>--no-pager</option> instead.</para></listitem> |
612ebf6c LP |
92 | </varlistentry> |
93 | ||
339bf207 ZJS |
94 | <varlistentry id='colors'> |
95 | <term><varname>$SYSTEMD_COLORS</varname></term> | |
96 | ||
97 | <listitem><para>The value must be a boolean. Controls whether colorized output should be | |
98 | generated. This can be specified to override the decision that <command>systemd</command> makes based | |
99 | on <varname>$TERM</varname> and what the console is connected to.</para> | |
100 | </listitem> | |
101 | </varlistentry> | |
102 | ||
c484315b ZJS |
103 | <!-- This is not documented on purpose, because it is not clear if $NO_COLOR will become supported |
104 | widely enough. So let's provide support, but without advertising this. | |
105 | <varlistentry id='no-color'> | |
106 | <term><varname>$NO_COLOR</varname></term> | |
107 | ||
108 | <listitem><para>If set (to any value), and <varname>$SYSTEMD_COLORS</varname> is not set, equivalent to | |
109 | <option>SYSTEMD_COLORS=0</option>. See <ulink url="https://no-color.org/">no-color.org</ulink>.</para> | |
110 | </listitem> | |
111 | </varlistentry> | |
112 | --> | |
113 | ||
339bf207 ZJS |
114 | <varlistentry id='urlify'> |
115 | <term><varname>$SYSTEMD_URLIFY</varname></term> | |
116 | ||
117 | <listitem><para>The value must be a boolean. Controls whether clickable links should be generated in | |
118 | the output for terminal emulators supporting this. This can be specified to override the decision that | |
119 | <command>systemd</command> makes based on <varname>$TERM</varname> and other conditions.</para> | |
120 | </listitem> | |
121 | </varlistentry> | |
122 | ||
123 | </variablelist> | |
21ac6ff1 | 124 | </refsect1> |