GNU bug report logs - #31105
[PATCH] Restart and reset ANSI escapes on each line for compatibility with less -R

Previous Next

Package: diffutils;

Reported by: "Dennis Lambe Jr." <malsyned <at> malsyned.net>

Date: Mon, 9 Apr 2018 08:04:02 UTC

Severity: normal

Tags: patch

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 31105 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: "Dennis Lambe Jr." <malsyned <at> malsyned.net>
Cc: 31105 <at> debbugs.gnu.org
Subject: Re: [bug-diffutils] bug#31105: bug#31105: [PATCH] Restart and reset
 ANSI escapes on each line for compatibility with less -R
Date: Sat, 29 Dec 2018 13:13:37 -0800
[Message part 1 (text/plain, inline)]
On Mon, Apr 9, 2018 at 12:02 PM Dennis Lambe Jr. <malsyned <at> malsyned.net> wrote:
>
> The previous patch had an error in the first hunk for normal.c. I
> forgot to remove an "if" line when I removed the following conditional
> line. Due to its placement before a "for" line that tested the same
> condition, it didn't affect the behavior of the patch, but it was
> unsightly. I've attached an updated patch.
>
> Quoting "Dennis Lambe Jr." <malsyned <at> malsyned.net>:
>
> > Hello!
> >
> > GNU less can display ANSI-colored text with the -R flag, but this
> > support has some limitations. One of them is that if an escape
> > sequence starts on one line and ends on a different line, only the
> > first line will be colored in less.
> >
> > As a result, when diff creates colored output with multi-line
> > deletes  or adds, less will only color the first line.
> >
> > I've attached a patch to reset ANSI color to the default at the end
> > of  every line and restart it at the beginning of the next. It
> > patches  normal and context mode. Side-by-side already worked in my
> > testing.
> >
> > I hope it's useful to you. Please let me know if there are changes
> > you  would like made before you can accept it.

Thank you for the contribution.
I've written a ChangeLog entry for you and attached a rebased commit.
However, the change is large enough that we'll also need a copyright
assignment from you. Can you do that?
Here are instructions:
https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.changes
[ansi-reset-less.diff (application/octet-stream, attachment)]

This bug report was last modified 6 years and 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.