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: Walter Doekes <walter <at> wjd.nu>, 456943 <at> bugs.debian.org
Cc: 15444 <at> debbugs.gnu.org
Subject: bug#15444: Bug#456943: (no subject)
Date: Mon, 25 Mar 2024 15:49:52 +0100
On 2016-07-14 14:22:15 -0700, Vincent Lefevre wrote:
> On 2016-07-14 09:02:48 +0200, Walter Doekes wrote:
> > Leon Meier wrote:
> > > As of today, the test case [...] still fails in (u)xterm.
> > > Any resolution in sight?
> > 
> > I tried to reproduce, and indeed, it fails on xterm (without the 'ne' grep
> > option), but not in gnome-terminal.
> > 
> > Does that mean that this is an xterm bug again and not a grep bug?
> 
> It is GNOME Terminal that is buggy, so that the grep bug is not
> visible.

A solution for "grep" would be to add a space+backspace before the
escape sequence.

Testcase:

for i in `seq 5` ; do printf "%0$(($(tput cols)+i-5))dab \bc\n" ; done | \
  GREP_COLORS="mt=41;97:ne" grep --color c

This works fine in Xterm, giving on a 80-column terminal:

0000000000000000000000000000000000000000000000000000000000000000000000000000abc
00000000000000000000000000000000000000000000000000000000000000000000000000000abc
000000000000000000000000000000000000000000000000000000000000000000000000000000abc
0000000000000000000000000000000000000000000000000000000000000000000000000000000abc
00000000000000000000000000000000000000000000000000000000000000000000000000000000abc

where only the "c" has the red background.

However, this triggers the bug in GNOME Terminal (and other
libvte-based terminals):

0000000000000000000000000000000000000000000000000000000000000000000000000000abc
00000000000000000000000000000000000000000000000000000000000000000000000000000ac 
000000000000000000000000000000000000000000000000000000000000000000000000000000abc
0000000000000000000000000000000000000000000000000000000000000000000000000000000abc
00000000000000000000000000000000000000000000000000000000000000000000000000000000abc

-- 
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.