GNU bug report logs - #15444
One character can be lost if colors are enabled

Previous Next

Package: grep;

Reported by: Jaroslav Skarvada <jskarvad <at> redhat.com>

Date: Mon, 23 Sep 2013 13:35:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Vincent Lefevre <vincent <at> vinc17.net>
To: 456943 <at> bugs.debian.org
Cc: 15444 <at> debbugs.gnu.org
Subject: bug#15444: Bug#456943: (no subject)
Date: Mon, 25 Mar 2024 18:02:54 +0100
On 2024-03-25 15:49:52 +0100, Vincent Lefevre wrote:
> A solution for "grep" would be to add a space+backspace before the
> escape sequence.

An additional note: One of the following is needed:

* Detect the end of line (this may be tricky) and split the coloring
  into 2 parts (each one with space + backspace + escape sequence)
  at this point. If this detection is incorrect, then the background
  problem would still be visible, but with no major drawbacks.

* Split the coloring so that each matching character gets a space +
  backspace + escape sequence. I think that this is acceptable since
  this trick should be used only when the output is a tty (i.e. it
  is not redirected to a file / not piped to a pager or something
  else).

-- 
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




This bug report was last modified 1 year and 79 days ago.

Previous Next


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