Created attachment 217340 [details] output.txt With the envariable LESS set to: LESS=-e -i -j4 -m -q -R -x4 -P"file %f (%i of %m) line %lb of %L [%pb\%]--" and the output shown in , less shows dashr.txt instead of the expected colorized output. Replacing -R with -r results in the expected colorization, and the expected long-line induced counting and screen layout issues. There are no LESSANSI* variables set. less 551, FreeBSD 12.1.
Created attachment 217341 [details] dashr.txt
Let's try this again. With the envariable LESS set to: LESS=-e -i -j4 -m -q -R -x4 -P"file %f (%i of %m) line %lb of %L [%pb\%]--" and the output shown in output.txt, less shows dashr.txt instead of the expected colorized output. Replacing -R with -r results in the expected colorization, and the expected long-line induced counting and screen layout issues. There are no LESSANSI* variables set. less 551, FreeBSD 12.1.
Is it regarding to the less(1) in the base (/usr/bin/less) or the less in the ports (sysutils/less) ?
In ports. I _think_ the older version in base works correctly. I've forgotten why I needed the newer version now.
Also CC delphij@, base less is 551 on 13.0-CURRENT.
That patch is so old, but I don’t have many terminals to test its removal with... You’re welcome to try removing it with a committer’s help.
I can confirm. ps --libxo json | jq -C | /usr/local/bin/less -R ESC[1;39m{ ESC[0mESC[34;1m"process-information"ESC[0mESC[1;39m: ESC[0mESC[1;39m{ ESC[0mESC[34;1m"process"ESC[0mESC[1;39m: ESC[0mESC[1;39m[ ESC[1;39m{ ESC[0mESC[34;1m"pid"ESC[0mESC[1;39m: ESC[0mESC[0;32m"24867"ESC[0mESC[1;39m, ESC[0mESC[34;1m"terminal-name"ESC[0mESC[1;39m: ESC[0mESC[0;32m"2 "ESC[0mESC[1;39m, ESC[0mESC[34;1m"state"ESC[0mESC[1;39m: ESC[0mESC[0;32m"Is+"ESC[0mESC[1;39m, ESC[0mESC[34;1m"cpu-time"ESC[0mESC[1;39m: ESC[0mESC[0;32m"0:03.15"ESC[0mESC[1;39m, ESC[0mESC[34;1m"command"ESC[0mESC[1;39m: ESC[0mESC[0;32m"zsh"ESC[0mESC[1;39m ESC[1;39m}ESC[0mESC[1;39m, After patch removed (correctly colored output): { "process-information": { "process": [ { "pid": "24867", "terminal-name": "2 ", "state": "Is+", "cpu-time": "0:03.15", "command": "zsh" }, Both in system console and in urxvt. > You’re welcome to try removing it with a committer’s help. I take it as maintainer is OK with removing it. While here, some minor cleanup to the port.
A commit references this bug: Author: amdmi3 Date: Wed Mar 17 19:39:37 UTC 2021 New revision: 568686 URL: https://svnweb.freebsd.org/changeset/ports/568686 Log: - Remove obsolete patch which breaks colorized output (-R option) - While here, fix LICENSE and switch to options helpers PR: 248754 Submitted by: jm-fbbz@yagi.h-net.org Approved by: jharris@widomaker.com (maintainer) Changes: head/sysutils/less/Makefile head/sysutils/less/files/patch-charset.c