Bug 248754 - sysutils/less: charset.c patch appears to break -R
Summary: sysutils/less: charset.c patch appears to break -R
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dmitry Marakasov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-19 15:53 UTC by Dennis Boone
Modified: 2021-03-17 19:39 UTC (History)
3 users (show)

See Also:
jharris: maintainer-feedback+


Attachments
output.txt (553 bytes, text/plain)
2020-08-19 15:53 UTC, Dennis Boone
no flags Details
dashr.txt (96 bytes, text/plain)
2020-08-19 15:54 UTC, Dennis Boone
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Boone 2020-08-19 15:53:17 UTC
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.
Comment 1 Dennis Boone 2020-08-19 15:54:51 UTC
Created attachment 217341 [details]
dashr.txt
Comment 2 Dennis Boone 2020-08-19 15:55:30 UTC
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.
Comment 3 Li-Wen Hsu freebsd_committer freebsd_triage 2020-08-19 16:44:46 UTC
Is it regarding to the less(1) in the base (/usr/bin/less) or the less in the ports (sysutils/less) ?
Comment 4 Dennis Boone 2020-08-19 17:18:12 UTC
In ports.  I _think_ the older version in base works correctly.  I've forgotten why I needed the newer version now.
Comment 5 Li-Wen Hsu freebsd_committer freebsd_triage 2020-08-19 17:23:29 UTC
Also CC delphij@, base less is 551 on 13.0-CURRENT.
Comment 6 jharris 2020-08-23 22:57:30 UTC
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.
Comment 7 Dmitry Marakasov freebsd_committer freebsd_triage 2021-03-17 19:24:46 UTC
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.
Comment 8 commit-hook freebsd_committer freebsd_triage 2021-03-17 19:39:59 UTC
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