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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: grep; Reported by: Jaroslav Skarvada <jskarvad@HIDDEN>; dated Mon, 23 Sep 2013 13:35:02 UTC; Maintainer for grep is bug-grep@HIDDEN.

Message received at 15444 <at> debbugs.gnu.org:


Received: (at 15444) by debbugs.gnu.org; 24 Sep 2013 07:41:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 24 03:41:09 2013
Received: from localhost ([127.0.0.1]:59864 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VONF5-0006Cm-8Q
	for submit <at> debbugs.gnu.org; Tue, 24 Sep 2013 03:41:08 -0400
Received: from mx4-phx2.redhat.com ([209.132.183.25]:51610)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <jskarvad@HIDDEN>) id 1VONF2-0006Cc-2v
 for 15444 <at> debbugs.gnu.org; Tue, 24 Sep 2013 03:41:05 -0400
Received: from zmail14.collab.prod.int.phx2.redhat.com
 (zmail14.collab.prod.int.phx2.redhat.com [10.5.83.16])
 by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r8O7f2sH001349;
 Tue, 24 Sep 2013 03:41:02 -0400
Date: Tue, 24 Sep 2013 03:41:01 -0400 (EDT)
From: Jaroslav Skarvada <jskarvad@HIDDEN>
To: Jim Meyering <jim@HIDDEN>
Message-ID: <554364705.1075194.1380008461304.JavaMail.root@HIDDEN>
In-Reply-To: <CA+8g5KEfGRN54JAwb0DsmDjT59WE+6HcEt8j0i=bbFvKriW=5g@HIDDEN>
References: <649516636.557185.1379942182710.JavaMail.root@HIDDEN>
 <1237403814.574122.1379943245507.JavaMail.root@HIDDEN>
 <CA+8g5KEfGRN54JAwb0DsmDjT59WE+6HcEt8j0i=bbFvKriW=5g@HIDDEN>
Subject: Re: bug#15444: One character can be lost if colors are enabled
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Originating-IP: [10.5.82.12]
X-Mailer: Zimbra 8.0.3_GA_5664 (ZimbraWebClient - FF23 (Linux)/8.0.3_GA_5664)
Thread-Topic: bug#15444: One character can be lost if colors are enabled
Thread-Index: gWGfAblcNhmNI0yqMm/GhLdAnIJ/+Q==
X-Spam-Score: -7.3 (-------)
X-Debbugs-Envelope-To: 15444
Cc: 15444 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -7.3 (-------)

----- Original Message -----
> On Mon, Sep 23, 2013 at 6:34 AM, Jaroslav Skarvada <jskarvad@HIDDEN>
> wrote:
> > printf
> > 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1234xxxxxxxxx\n'
> > | grep 1234 --color=always
> 
> Thank you for the report.
> I confirm that setting GREP_COLORS=ne is a work-around.  Does that
> have unwelcome side effects on any other type of terminal that you've
> tried?
> 
It's only workaround, I think it cannot be used by default, because
it can have undesired effect if custom background is used, e.g.:

$ printf 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx12345x\n' | GREP_COLORS='sl=01;41:ne' grep --color=always 1234

(on some terms you need to repeat this more times until the term
vertically scrolls to see the difference w/wo 'ne').

From the discussion in the original report it seems, the reported
xterm autowrap behaviour is DEC VT100 feature (for me historical bug
that became feature) and could be deduced from the xenl terminfo
capability. But as e.g. libvte interprets this different way, there
is probably no simple fix (even in case grep would read terminfo).
Maybe the xterm upstream will come with some idea

Jaroslav





Information forwarded to bug-grep@HIDDEN:
bug#15444; Package grep. Full text available.

Message received at 15444 <at> debbugs.gnu.org:


Received: (at 15444) by debbugs.gnu.org; 23 Sep 2013 17:36:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 23 13:36:39 2013
Received: from localhost ([127.0.0.1]:58577 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VOA3r-0002VV-26
	for submit <at> debbugs.gnu.org; Mon, 23 Sep 2013 13:36:39 -0400
Received: from mail-pa0-f49.google.com ([209.85.220.49]:51203)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <meyering@HIDDEN>) id 1VOA3o-0002VG-VT
 for 15444 <at> debbugs.gnu.org; Mon, 23 Sep 2013 13:36:37 -0400
Received: by mail-pa0-f49.google.com with SMTP id ld10so3849897pab.36
 for <15444 <at> debbugs.gnu.org>; Mon, 23 Sep 2013 10:36:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:from:date:message-id
 :subject:to:cc:content-type;
 bh=3EfGdZ+celOo9xxf8D58FTBVB926WEuUCOAm1MMAWoc=;
 b=malbalVjZ3TkHJuXdKL0ieMhhKTDW5KuVA2LjRWqMbym3LLudRS2+EyzVM8s6rLs64
 92259NdcJgfok0MLpIY6GkCOnCdbXAXta5QTM8oerb4PYga5KYuWBi5ybNs9Bem04AKA
 Vj0pvnF2hT8wlRlombL8SZ/PItBSv703LQtJNyF9Jc5vWUKQWhXXOPRsLufe+55mXGAH
 h1yR4GWN+2x5t4LW6+SRYraT6VZK+y5qio3IEGmcoCiruXsZMe0UzpF9uVUt4da42Mx4
 Ynb/FaAZCaqE6Z7pHVynI5W5H6n0rypeo35Mnb648LhDUAjSJ3adUsj9j9964HlKjbIb
 BvFA==
X-Received: by 10.68.180.34 with SMTP id dl2mr14731983pbc.6.1379957790825;
 Mon, 23 Sep 2013 10:36:30 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.68.6.66 with HTTP; Mon, 23 Sep 2013 10:35:58 -0700 (PDT)
In-Reply-To: <1237403814.574122.1379943245507.JavaMail.root@HIDDEN>
References: <649516636.557185.1379942182710.JavaMail.root@HIDDEN>
 <1237403814.574122.1379943245507.JavaMail.root@HIDDEN>
From: Jim Meyering <jim@HIDDEN>
Date: Mon, 23 Sep 2013 10:35:58 -0700
X-Google-Sender-Auth: 7Ao6tLIdOvOUBLeQqF9-6iCN4FI
Message-ID: <CA+8g5KEfGRN54JAwb0DsmDjT59WE+6HcEt8j0i=bbFvKriW=5g@HIDDEN>
Subject: Re: bug#15444: One character can be lost if colors are enabled
To: Jaroslav Skarvada <jskarvad@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 15444
Cc: 15444 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

On Mon, Sep 23, 2013 at 6:34 AM, Jaroslav Skarvada <jskarvad@HIDDEN> wrote:
> printf 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1234xxxxxxxxx\n' | grep 1234 --color=always

Thank you for the report.
I confirm that setting GREP_COLORS=ne is a work-around.  Does that
have unwelcome side effects on any other type of terminal that you've
tried?




Information forwarded to bug-grep@HIDDEN:
bug#15444; Package grep. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Sep 2013 13:34:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 23 09:34:41 2013
Received: from localhost ([127.0.0.1]:57946 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VO6Hg-0003pD-Co
	for submit <at> debbugs.gnu.org; Mon, 23 Sep 2013 09:34:41 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56642)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <jskarvad@HIDDEN>) id 1VO6Hb-0003ot-Hk
 for submit <at> debbugs.gnu.org; Mon, 23 Sep 2013 09:34:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jskarvad@HIDDEN>) id 1VO6HN-0005jp-QG
 for submit <at> debbugs.gnu.org; Mon, 23 Sep 2013 09:34:30 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:57297)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jskarvad@HIDDEN>) id 1VO6HN-0005jl-Nt
 for submit <at> debbugs.gnu.org; Mon, 23 Sep 2013 09:34:21 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58345)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jskarvad@HIDDEN>) id 1VO6HH-0001yL-Jy
 for bug-grep@HIDDEN; Mon, 23 Sep 2013 09:34:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <jskarvad@HIDDEN>) id 1VO6HB-0005gs-Kt
 for bug-grep@HIDDEN; Mon, 23 Sep 2013 09:34:15 -0400
Received: from mx4-phx2.redhat.com ([209.132.183.25]:35247)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <jskarvad@HIDDEN>) id 1VO6HB-0005gh-Cj
 for bug-grep@HIDDEN; Mon, 23 Sep 2013 09:34:09 -0400
Received: from zmail14.collab.prod.int.phx2.redhat.com
 (zmail14.collab.prod.int.phx2.redhat.com [10.5.83.16])
 by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r8NDY8Ft020262
 for <bug-grep@HIDDEN>; Mon, 23 Sep 2013 09:34:08 -0400
Date: Mon, 23 Sep 2013 09:34:05 -0400 (EDT)
From: Jaroslav Skarvada <jskarvad@HIDDEN>
To: bug-grep@HIDDEN
Message-ID: <1237403814.574122.1379943245507.JavaMail.root@HIDDEN>
In-Reply-To: <649516636.557185.1379942182710.JavaMail.root@HIDDEN>
Subject: One character can be lost if colors are enabled
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Originating-IP: [10.5.82.11]
X-Mailer: Zimbra 8.0.3_GA_5664 (ZimbraWebClient - FF23 (Linux)/8.0.3_GA_5664)
Thread-Topic: One character can be lost if colors are enabled
Thread-Index: AYWhRYLQ5bDuN0lWiV+Oj3poa8DTKA==
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

Reproducer:
$ printf 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1234xxxxxxxxx\n' | grep 1234 --color=always
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx123xxxxxxxxx

This can be reproduced at least on xterm and linux console,
but it works on xfce4-terminal and konsole (at least).

The EL command (\E[K) is sent to clear the line. The VT100
terminal autowraps when the 81th character is received and the
EL command is not counted as a character. So if 80 characters
are received, it waits on the 80th character and the following
EL command erases characters from the current one to the end
of line (i.e. the last character on the line).

Workaround is to use GREP_COLORS=ne.

The original Red Hat bugzilla that contains discussion with
the xterm upstream:

http://bugzilla.redhat.com/show_bug.cgi?id=1006310




Acknowledgement sent to Jaroslav Skarvada <jskarvad@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-grep@HIDDEN. Full text available.
Report forwarded to bug-grep@HIDDEN:
bug#15444; Package grep. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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