Bug#1104623: apt: pager settings break long lines

Max Nikulin <[email protected]> Fri, 2 Jan 2026 15:11:32 +0700
Newsgroups gmane.linux.debian.apt.devel
Message-ID <c369732e-1b0c-4944-9af2-87898928a7e1__48799.6987578057$1767341608$gmane$org@gmail.com>
On Sat, 03 May 2025 10:21:35 +0200 Antoine Le Gonidec wrote
> current behaviour: LESS=FRSXMK apt show mono-devel/trixie
> expected behaviour: LESS=FRXMK apt show mono-devel/trixie
I was confused by the commit message and the related issue title as well.

On Sat, 03 May 2025 10:49:11 +0200 Julian Andres Klode wrote:
> This is already being discussed in
> <https://salsa.debian.org/apt-team/apt/-/merge_requests/470#note_609281>
In systemd "S" was added in the initial commit

<https://github.com/systemd/systemd/commit/0736af98c6>
2011-01-02 00:25:57 +0100 Miklos Vajna
systemctl: implement auto-pager a la git

and unlike later added options like "K" the reason is not justified,
see <https://manpages.debian.org/journalctl.1#:~:text=$SYSTEMD_LESS>.
I have not noticed a bugzilla issue for adding pager, just a request
to suppress "S"
<https://bugs.freedesktop.org/show_bug.cgi?id=35725>

For APT, besides hidden dependencies in "apt show PACKAGE", I see a
couple of related issues:
- APT pager is not described in the docs, launchpad issues are more
   informative.
- It can not be adjusted through APT configuration files. Environment
   set through /etc/profile.d/ may be unavailable in terminal
   applications spawned directly from systemd user session
   by GUI launchers.

Despite both systemd and apt implementations were inspired by git (that,
by the way, does have "S" by default), details are rather different, so
docs, what environment variables are respected, are important.

I like that apt allows to override specific options without specifying
all defaults one. On the other hand LESS environment variable caused
issues for some users: debian-user, Re: apt show escape characters,
Fri, 7 Nov 2025 21:59:21 -0600
<https://lists.debian.org/msgid-search/?m=aQ7AGfTNpf%[email protected]>

For those who, like me, frequently uses "-" "S" in journalctl and finds 
annoying trimmed log lines in "systemctl status UNIT", the workaround 
for APT (I find convenient ignore case search in man)

     APT_PAGER="less -i -+S --wordwrap"
     export APT_PAGER

(In general case one may wish to test if less(1) is installed.)
For details see
<https://manpages.debian.org/git-config.1#:~:text=core.pager>