#1104623 apt: pager settings break long lines

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Antoine Le Gonidec
Date:
2026-01-02 08:13:02 UTC
Severity:
normal
#1104623#5
Date:
2025-05-03 08:21:35 UTC
From:
To:
apt 2.9.35, and more specifically commit 805ddd0ac, broke long lines
display when using less as a pager. Instead of being warped on end of
line, anything going beyond the screen limit is hidden.

The following commands illustrate the problem (check the Dependencies field):
current behaviour: LESS=FRSXMK apt show mono-devel/trixie
expected behaviour: LESS=FRXMK apt show mono-devel/trixie

According to commit 805ddd0ac, the -S option was added to disable the
terminal bell. But this is not what it does, cf. less(1):

The attached patch restores the expected behaviour. It does not fully
revert commit 805ddd0ac, but only drops the -S option that was most
probably added by mistake.

#1104623#12
Date:
2025-05-03 08:46:31 UTC
From:
To:
Control: tag -1 - patch

That's discussed in
<https://salsa.debian.org/apt-team/apt/-/merge_requests/470#note_609281>

None of the reportbug crap is relevant here, why even submit it?

This is really painful to edit out when not on a proper mail client.

#1104623#19
Date:
2025-05-03 08:49:11 UTC
From:
To:
Control: tag -1 - patch

This is already being discussed in
<https://salsa.debian.org/apt-team/apt/-/merge_requests/470#note_609281>

#1104623#24
Date:
2026-01-02 08:11:32 UTC
From:
To:
On Sat, 03 May 2025 10:21:35 +0200 Antoine Le Gonidec wrote
I was confused by the commit message and the related issue title as well.
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%2fDChVF@yahoo.com>

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>