On 09/10/2026 13:26, Eli Schwartz wrote:
On 10/9/26 7:42 AM, Pádraig Brady wrote:
On 09/10/2026 08:13, Eli Schwartz wrote:
to disable bold/underline/links in help text, but I think the underlying
principle is the same and I don't really know that I understand the
rationale for assuming by default that it will be read by less or, more
pertinently, that users have configured less to get [readable] output
IMHO less(1) should enable -R by default.
Does anyone want less(1) to not show colors for example?
I.e. if you leave less(1) with default settings, this also messes up:
ls --color | less
But fair enough we should work on getting less to change its default
before trying to force the situation.
Well, you won't get any opposing arguments from me, I guess. :)
Depending on the escape sequences used, i.e. not color codes but things
like changing the window title (especially when done fairly often e.g.
to report the number and identity of running, pending, and completed
jobs by the Gentoo package manager), you can potentially end up with a
logfile quite littered by escape sequences, that when processed by less
-R end up hiding parts of the logfile. I suppose you could say that's a
bug in less itself, but I guess it makes people a bit nervous to trust
it? But I'd rather selectively disable -R in rare cases, and leave the
default to be showing colors.
less v712 will enable -R by default:
https://github.com/gwsw/less/commit/5ee3ca4d
Meanwhile, in a terminal that supports them, I can normally click on ls
--help's hyperlinks, but piping it to less -R actually breaks that, and
I don't know whether it's supposed to work (or how), so the feature
simply has my heartiest shrugs.
`ls --help | less -R` should work.
What version of less are you using?
less 704, but upgrading to less 710 makes no difference here.
I used Konsole to test (requires configuration to enable), FWIW.
To summarize this separate issue for possible future readers.
less(1) was fine in this regard.
It was Konsole that has bugs in this area,
the worst consequence being URLs are not clickable,
so not a big problem.
cheers,
Padraig