Am 25.05.22 um 14:51 schrieb Vincent Lefevre:
Control: reopen -1

On 2022-05-25 13:28:31 +0200, Michael Biebl wrote:
Am 24.05.22 um 15:23 schrieb Vincent Lefevre:
Package: systemd
Version: 251-2
Severity: minor

Note: on my machine, /usr/bin/pager points to the "less" alternative.

When I run journalctl, searching for strings in the "less" pager is
case-sensitive, while I have -i in $LESS.

I've eventually found that my LESS environment variable was replaced
by "FRSXMK", but this is not documented.

This is documented here:
https://www.freedesktop.org/software/systemd/man/journalctl.html#%24SYSTEMD_LESS

There is no mention of the LESS environment variable there.
As I read "options passed to less", this consists in running
"less -FRSXMK" (this is the usual way options are passed to
programs and has the advantage to honor some options of the
user's LESS environment variable, like "-i"). If it passes
options via the LESS environment variable, then the manual
should say something like

It doesn't pass the LESS environment variable that's defined in the user session to the pager but runs that program in a defined, fixed and tested environment.

Internally it uses the LESS environment variable to pass those options to less.

See
https://github.com/systemd/systemd/blob/main/src/shared/pager.c#L132
https://github.com/systemd/systemd/blob/main/src/shared/pager.c#L158


It's basically the same with systemctl, where the environment of the user executing the command does not leak into the environment of the service (say PATH).

This is by design I'd say.




Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to