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; 25 Mar 2024 15:32:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 25 11:32:17 2024
Received: from localhost ([127.0.0.1]:35711 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1romJ7-0000DL-K7
	for submit <at> debbugs.gnu.org; Mon, 25 Mar 2024 11:32:17 -0400
Received: from cventin.lip.ens-lyon.fr ([140.77.13.17]:47756)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <vincent@HIDDEN>) id 1romJ4-0000D5-WB
 for 15444 <at> debbugs.gnu.org; Mon, 25 Mar 2024 11:32:15 -0400
Received: from vlefevre by cventin.lip.ens-lyon.fr with local (Exim 4.97)
 (envelope-from <vincent@HIDDEN>) id 1role4-00000000462-2BNO;
 Mon, 25 Mar 2024 15:49:52 +0100
Date: Mon, 25 Mar 2024 15:49:52 +0100
From: Vincent Lefevre <vincent@HIDDEN>
To: Walter Doekes <walter@HIDDEN>, 456943@HIDDEN
Subject: Re: Bug#456943: (no subject)
Message-ID: <20240325144952.GA2199@HIDDEN>
References: <caa708d0-b4ba-4d8c-66f9-075cf51c0a19@HIDDEN>
 <c2da85064f06e96c529fa4abbc782b21.squirrel@HIDDEN>
 <20160714212215.GB5305@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20160714212215.GB5305@HIDDEN>
X-Mailer-Info: https://www.vinc17.net/mutt/
User-Agent: Mutt/2.2.12+69 (354c5b11) vl-149028 (2023-12-10)
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  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. > > > An [...]
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 2.0 SLIGHTLY_BAD_SUBJECT   Subject contains something slightly spammy
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
X-Debbugs-Envelope-To: 15444
Cc: 15444 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: 1.0 (+)

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@HIDDEN> - 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)




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; 15 Jul 2016 05:18:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 15 01:18:14 2016
Received: from localhost ([127.0.0.1]:51940 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bNvVt-0007Kh-OU
	for submit <at> debbugs.gnu.org; Fri, 15 Jul 2016 01:18:13 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56964)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pj@HIDDEN>) id 1bNvVr-0007KR-9I
 for submit <at> debbugs.gnu.org; Fri, 15 Jul 2016 01:18:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <pj@HIDDEN>) id 1bNvVl-0005rQ-6i
 for submit <at> debbugs.gnu.org; Fri, 15 Jul 2016 01:18:05 -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,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:54685)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <pj@HIDDEN>)
 id 1bNvVl-0005rK-0f
 for submit <at> debbugs.gnu.org; Fri, 15 Jul 2016 01:18:05 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47924)
 by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <pj@HIDDEN>)
 id 1bNvVi-0000fW-VE
 for bug-grep@HIDDEN; Fri, 15 Jul 2016 01:18:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <pj@HIDDEN>) id 1bNvVe-0005qo-O1
 for bug-grep@HIDDEN; Fri, 15 Jul 2016 01:18:01 -0400
Received: from out5-smtp.messagingengine.com ([66.111.4.29]:48061)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <pj@HIDDEN>)
 id 1bNvVd-0005qb-Hx
 for bug-grep@HIDDEN; Fri, 15 Jul 2016 01:17:58 -0400
Received: from compute6.internal (compute6.nyi.internal [10.202.2.46])
 by mailout.nyi.internal (Postfix) with ESMTP id E6AE620471
 for <bug-grep@HIDDEN>; Fri, 15 Jul 2016 01:17:52 -0400 (EDT)
Received: from web3 ([10.202.2.213])
 by compute6.internal (MEProxy); Fri, 15 Jul 2016 01:17:52 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
 messagingengine.com; h=content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=7GeROkdY0jj5Ip3
 4wug2PxkXTRo=; b=icycKESmWMLhf/YKFUa7UgaEdjUdFzp+ETd5Bn7Go2lOnt6
 7ROKKgyf2sSIXtx0N4ZzeBpQw8+raZXJmZqLP0FJQ1WvEtHlQbd8c/BVh+g6NPtT
 UWOaZqAO11qUhyIWgcj4KSx1bom+2HYdM9gdq/8dVC3f0C/PQko2meVCiyeM=
Received: by mailuser.nyi.internal (Postfix, from userid 99)
 id B8383161A9; Fri, 15 Jul 2016 01:17:52 -0400 (EDT)
Message-Id: <1468559872.2959316.666910489.33F75EBF@HIDDEN>
X-Sasl-Enc: nkMq/KVkbkHuGYVdFfs9iiuTcwT9J8+NNWg1zLSGFHq3 1468559872
From: Paul Jackson <pj@HIDDEN>
To: bug-grep@HIDDEN
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain
X-Mailer: MessagingEngine.com Webmail Interface - ajax-bf4e2c8f
Subject: Re: bug#15444: (no subject)
Date: Fri, 15 Jul 2016 00:17:52 -0500
In-Reply-To: <7f63c635-f0d7-a842-e8c7-ad317bb1a22c@HIDDEN>
References: <1237403814.574122.1379943245507.JavaMail.root@HIDDEN>
 <7f63c635-f0d7-a842-e8c7-ad317bb1a22c@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -2.3 (--)

Leon wrote:
>> Sorry; in my previous e-mail there was a wraparound induced by the e-mail composer. This one is hopefully better:
>> $ echo "                                                                               "| grep --color=always '[1-9]'
>> 
>>     python2 -c 'print " " * 80, 1234' | grep --color=auto '[1-9]'
>> 
>> This one does work for a standard 80-char-wide (u)xterm.

The above two commands are not the same.

That echo command seems to emit 79 spaces, followed by one newline (but no numbers at all ??)

That (my) python2 command emits 81 spaces, the four numbers, and a newline.

Try this one (fixing my off-by-one space count, as the ',' comma in print args emits a space of its own):

 python2 -c 'print " " * 79, 1234' | grep --color=always '[1-9]'

And try this one (fixing what I guess is your accidental omission of one space and  the four numbers):

echo "                                                                                1234"| grep --color=always '[1-9]'

I get the same results from either of the last two test cases above, with the red "1234" numbers
NOT appearing in an 80 wide xterm or uxterm, but appearing ok if I widen the terminal.

-- 
                Paul Jackson
                pj@HIDDEN




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; 14 Jul 2016 21:22:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 14 17:22:24 2016
Received: from localhost ([127.0.0.1]:51821 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bNo5P-00079c-Q3
	for submit <at> debbugs.gnu.org; Thu, 14 Jul 2016 17:22:23 -0400
Received: from ioooi.vinc17.net ([92.243.22.117]:46477)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <vincent@HIDDEN>) id 1bNo5M-00079R-6f
 for 15444 <at> debbugs.gnu.org; Thu, 14 Jul 2016 17:22:21 -0400
Received: from smtp-zira.vinc17.net (unknown [216.9.110.15])
 by ioooi.vinc17.net (Postfix) with ESMTPSA id EFD64603;
 Thu, 14 Jul 2016 23:22:17 +0200 (CEST)
Received: by zira.vinc17.org (Postfix, from userid 1000)
 id BF0A9C245BD; Thu, 14 Jul 2016 14:22:15 -0700 (PDT)
Date: Thu, 14 Jul 2016 14:22:15 -0700
From: Vincent Lefevre <vincent@HIDDEN>
To: Walter Doekes <walter@HIDDEN>, 456943@HIDDEN
Subject: Re: Bug#456943: (no subject)
Message-ID: <20160714212215.GB5305@HIDDEN>
References: <caa708d0-b4ba-4d8c-66f9-075cf51c0a19@HIDDEN>
 <c2da85064f06e96c529fa4abbc782b21.squirrel@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <c2da85064f06e96c529fa4abbc782b21.squirrel@HIDDEN>
X-Mailer-Info: https://www.vinc17.net/mutt/
User-Agent: Mutt/1.6.2-6722-vl-r89564 (2016-07-11)
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.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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 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.

-- 
Vincent Lefèvre <vincent@HIDDEN> - 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)




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; 14 Jul 2016 15:39:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 14 11:39:05 2016
Received: from localhost ([127.0.0.1]:51619 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bNijB-0004Ab-8s
	for submit <at> debbugs.gnu.org; Thu, 14 Jul 2016 11:39:05 -0400
Received: from forward11h.cmail.yandex.net ([87.250.230.153]:41462)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Leon.Meier@HIDDEN>) id 1bNctF-0000eb-U7
 for 15444 <at> debbugs.gnu.org; Thu, 14 Jul 2016 05:25:06 -0400
Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68])
 by forward11h.cmail.yandex.net (Yandex) with ESMTP id B03EA2160D
 for <15444 <at> debbugs.gnu.org>; Thu, 14 Jul 2016 12:24:59 +0300 (MSK)
Received: from smtp13.mail.yandex.net (localhost [127.0.0.1])
 by smtp13.mail.yandex.net (Yandex) with ESMTP id ADC9CE40439
 for <15444 <at> debbugs.gnu.org>; Thu, 14 Jul 2016 12:24:59 +0300 (MSK)
Received: by smtp13.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id
 D79Z8d0elh-Ow2eH6Mw; Thu, 14 Jul 2016 12:24:59 +0300
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client certificate not present)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
 t=1468488299; bh=sZz5ggjaee3FnKyPEF+ykfX4KlCIX4GY8qZBMAR3iew=;
 h=From:To:Message-ID:Date;
 b=qib7g848RCabUoGby2PE5ayR7OylJ4ZjCtEu0eYo1zkypJZHn7JwnSIr1KZfIoZ7f
 L15HJ/z1Uj3R91rIOEiDloLZFof5A1DjVztyMnGX6QL3sjQQB8Kz3/1K6V4bnKBPOx
 NXKYhZRD7VWKy09DKx9GC7o5JkGP8cZErSa00BbE=
Authentication-Results: smtp13.mail.yandex.net; dkim=pass header.i=@yandex.ru
X-Yandex-Suid-Status: 1 0
From: Leon Meier <Leon.Meier@HIDDEN>
To: 15444 <at> debbugs.gnu.org
Message-ID: <7f63c635-f0d7-a842-e8c7-ad317bb1a22c@HIDDEN>
Date: Thu, 14 Jul 2016 11:24:58 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Icedove/45.1.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: > Does the following also fail for you? It uses python
 instead
 of > (difficult to see in email) explicit spaces to get the 80 spaces. Sorry; 
 in my previous e-mail there was a wraparound induced by the e-mail composer.
 This one is hopefully better: $ echo " "| grep --color=always '[1-9]' [...]
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
 trust [87.250.230.153 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
 [87.250.230.153 listed in wl.mailspike.net]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (leon.meier[at]yandex.ru)
 1.8 MISSING_SUBJECT        Missing Subject: header
 0.2 NO_SUBJECT             Extra score for no subject
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
 0.0 T_DKIM_INVALID         DKIM-Signature header exists but is not valid
X-Debbugs-Envelope-To: 15444
X-Mailman-Approved-At: Thu, 14 Jul 2016 11:39:04 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  > Does the following also fail for you? It uses python instead
    of > (difficult to see in email) explicit spaces to get the 80 spaces. Sorry;
    in my previous e-mail there was a wraparound induced by the e-mail composer.
    This one is hopefully better: $ echo " "| grep --color=always '[1-9]' [...]
    
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_MSPIKE_H3      RBL: Good reputation (+3)
                             [87.250.230.153 listed in wl.mailspike.net]
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
                             trust
                             [87.250.230.153 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail provider
                             (leon.meier[at]yandex.ru)
  1.8 MISSING_SUBJECT        Missing Subject: header
  0.2 NO_SUBJECT             Extra score for no subject
 -0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders
  0.0 T_DKIM_INVALID         DKIM-Signature header exists but is not valid

> Does the following also fail for you?  It uses python instead of
> (difficult to see in email) explicit spaces to get the 80 spaces.
Sorry; in my previous e-mail there was a wraparound induced by the e-mail composer. This one is hopefully better:
$ echo "                                                                               "| grep --color=always '[1-9]'

> python2 -c 'print " " * 80, 1234' | grep --color=auto '[1-9]'
This one does work for a standard 80-char-wide (u)xterm.







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; 14 Jul 2016 15:37:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 14 11:37:56 2016
Received: from localhost ([127.0.0.1]:51610 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bNii3-00047i-Vj
	for submit <at> debbugs.gnu.org; Thu, 14 Jul 2016 11:37:56 -0400
Received: from wjd.osso.nl ([217.21.198.142]:44815 helo=wjdsys.wjd.nu)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <walter@HIDDEN>) id 1bNafc-0003lO-PU
 for 15444 <at> debbugs.gnu.org; Thu, 14 Jul 2016 03:02:54 -0400
Received: by wjdsys.wjd.nu (Postfix, from userid 33)
 id 8B6A29611C; Thu, 14 Jul 2016 09:02:48 +0200 (CEST)
Received: from 91.194.225.4 (SquirrelMail authenticated user walter@HIDDEN)
 by mail.wjd.nu with HTTP; Thu, 14 Jul 2016 09:02:48 +0200
Message-ID: <c2da85064f06e96c529fa4abbc782b21.squirrel@HIDDEN>
In-Reply-To: <caa708d0-b4ba-4d8c-66f9-075cf51c0a19@HIDDEN>
References: <caa708d0-b4ba-4d8c-66f9-075cf51c0a19@HIDDEN>
Date: Thu, 14 Jul 2016 09:02:48 +0200
Subject: Re: Bug#456943: (no subject)
From: "Walter Doekes" <walter@HIDDEN>
To: 456943@HIDDEN
User-Agent: SquirrelMail/1.4.23 [SVN]
MIME-Version: 1.0
Content-Type: text/plain;charset=utf-8
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  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.
 [...] Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 2.0 SLIGHTLY_BAD_SUBJECT   Subject contains something slightly spammy
 -0.0 SPF_PASS               SPF: sender matches SPF record
X-Debbugs-Envelope-To: 15444
X-Mailman-Approved-At: Thu, 14 Jul 2016 11:37:55 -0400
Cc: 15444 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  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.
    [...] 
 
 Content analysis details:   (2.0 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  2.0 SLIGHTLY_BAD_SUBJECT   Subject contains something slightly spammy
 -0.0 SPF_PASS               SPF: sender matches SPF record

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?

See this:
http://wjd.nu/files/2016/07/debian-bug-456943.png?view


This works both in gnome-terminal and xterm:

  python -c 'print(" "*'$COLUMNS'+"1234")' |
    GREP_COLORS=ne grep --color=auto '[1-9]'

This works in gnome-terminal and *fails* in xterm:

  python -c 'print(" "*'$COLUMNS'+"1234")' |
    grep --color=auto '[1-9]'

Versions (Ubuntu, Trusty, latest):

  gnome-terminal 3.6.2-0ubuntu1
  grep 2.16-1
  xterm 297-1ubuntu1

Greetings,
Walter Doekes




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; 13 Jul 2016 22:37:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 13 18:37:38 2016
Received: from localhost ([127.0.0.1]:50276 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bNSmg-0001Yc-MD
	for submit <at> debbugs.gnu.org; Wed, 13 Jul 2016 18:37:38 -0400
Received: from eggs.gnu.org ([208.118.235.92]:59048)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <pj@HIDDEN>) id 1bNSme-0001YO-W1
 for submit <at> debbugs.gnu.org; Wed, 13 Jul 2016 18:37:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <pj@HIDDEN>) id 1bNSmZ-00037l-2Z
 for submit <at> debbugs.gnu.org; Wed, 13 Jul 2016 18:37:31 -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,T_DKIM_INVALID
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:38705)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <pj@HIDDEN>)
 id 1bNSmY-00037g-Sm
 for submit <at> debbugs.gnu.org; Wed, 13 Jul 2016 18:37:30 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50005)
 by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <pj@HIDDEN>)
 id 1bNSmW-0005mP-KF
 for bug-grep@HIDDEN; Wed, 13 Jul 2016 18:37:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <pj@HIDDEN>) id 1bNSmS-00036y-Dh
 for bug-grep@HIDDEN; Wed, 13 Jul 2016 18:37:27 -0400
Received: from out5-smtp.messagingengine.com ([66.111.4.29]:39568)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <pj@HIDDEN>)
 id 1bNSmR-00036i-27
 for bug-grep@HIDDEN; Wed, 13 Jul 2016 18:37:24 -0400
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
 by mailout.nyi.internal (Postfix) with ESMTP id 1BF5A20850
 for <bug-grep@HIDDEN>; Wed, 13 Jul 2016 18:37:19 -0400 (EDT)
Received: from web3 ([10.202.2.213])
 by compute3.internal (MEProxy); Wed, 13 Jul 2016 18:37:19 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
 messagingengine.com; h=content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=fyc9qa0Ylsz4rmu
 w9NegzCznF8U=; b=KLQ0U1meB5VJGZkOH85+xLNCEOcCG7b6JsH+1nXChNw+GPC
 Bru49GMGxBRt1SUx7dxpp6ITYensROwYkFZg6TR1GOexur3+eKyfXxMjbvxUy8Ri
 aBjHjtg3BmDmVc8VH+nV3rA0bhsEdQ9XT7ob46fG7Xvr+bozc6UToKoQtujw=
Received: by mailuser.nyi.internal (Postfix, from userid 99)
 id E458016711; Wed, 13 Jul 2016 18:37:18 -0400 (EDT)
Message-Id: <1468449438.3221809.665600449.4C8FDC5A@HIDDEN>
X-Sasl-Enc: ZXjEz73/ES0/GY3xrLDKeaT93A6BYuBQWZomd4on861q 1468449438
From: Paul Jackson <pj@HIDDEN>
To: bug-grep@HIDDEN
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain
X-Mailer: MessagingEngine.com Webmail Interface - ajax-bf4e2c8f
Subject: Re: bug#15444: (no subject)
Date: Wed, 13 Jul 2016 17:37:18 -0500
In-Reply-To: <caa708d0-b4ba-4d8c-66f9-075cf51c0a19@HIDDEN>
References: <1237403814.574122.1379943245507.JavaMail.root@HIDDEN>
 <caa708d0-b4ba-4d8c-66f9-075cf51c0a19@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -2.4 (--)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -2.4 (--)

Leon wrote:
>> As of today, the test case
>> 
>> echo " 
>>              1234" | grep --color=auto '[1-9]'
>>   (80 spaces and 1234)
>> 
>> still fails in (u)xterm. Any resolution in sight?

Does the following also fail for you?  It uses python instead of
(difficult to see in email) explicit spaces to get the 80 spaces.

python2 -c 'print " " * 80, 1234' | grep --color=auto '[1-9]'

However they both appear to fail in uxterm, IF I have the
terminal set to 80 columns wide.  If the terminal is wider,
then I can see the red 1234 out in "right field".  For example,
if the terminal is 84 chars wide, I can see the red "12", but
not the "34", unless the terminal is at least 86 chars wide.

If I invoke uxterm with the -cm option, to disable ANSI color
sequences, then the extra 2 bytes aren't needed, and a terminal
that's 84 chars wide will show all, uncolored,  four "1234" numbers.

In xterm, I need a terminal 82 chars wide (not 84 like uxterm)
to see the red "12", and I need a terminal of 84 chars wide
(not 86 like uxterm) to see all four red numbers "1234".

I did not double check the perfection of the above details,
so might be off by one or two, here or there.

But I'd guess that this might be a "bug" (unexpected feature)
in the terminal emulator's handling of ANSI color escape
sequences, rather than a bug in grep.

-- 
                Paul Jackson
                pj@HIDDEN




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; 13 Jul 2016 22:00:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 13 18:00:34 2016
Received: from localhost ([127.0.0.1]:50251 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bNSCo-0000gG-5q
	for submit <at> debbugs.gnu.org; Wed, 13 Jul 2016 18:00:34 -0400
Received: from forward19p.cmail.yandex.net ([77.88.31.22]:52600)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <Leon.Meier@HIDDEN>) id 1bNRcv-0008E6-CZ
 for 15444 <at> debbugs.gnu.org; Wed, 13 Jul 2016 17:23:30 -0400
Received: from smtp14.mail.yandex.net (smtp14.mail.yandex.net
 [IPv6:2a02:6b8:0:801:1::13])
 by forward19p.cmail.yandex.net (Yandex) with ESMTP id AEA7421538;
 Thu, 14 Jul 2016 00:23:22 +0300 (MSK)
Received: from smtp14.mail.yandex.net (localhost [127.0.0.1])
 by smtp14.mail.yandex.net (Yandex) with ESMTP id AADE81B60365;
 Thu, 14 Jul 2016 00:23:22 +0300 (MSK)
Received: by smtp14.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id
 8tOdQLj8tv-NLd0tM0Z; Thu, 14 Jul 2016 00:23:22 +0300
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client certificate not present)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
 t=1468445002; bh=nXg8zBuH5qE61x+Wxuq6Ur+N4lgk/PyB5BROv9q6KHU=;
 h=To:From:Message-ID:Date;
 b=K1JZYkiXKLUz4FtKeMbz1fgaDJ+/+9Gj/CAhizCGi8SChsebJSs6GHkEXMK1Xwj/S
 cGxsrPLARaSaWJqtkf3dNR/GDB4f0I0oGPLNDwz9e/BOosla1Chp1XagnYQ+zmVOu6
 EjC+fsgYag84tKdjHlt3zidaLiNTztMxt/RMjvM4=
Authentication-Results: smtp14.mail.yandex.net; dkim=pass header.i=@yandex.ru
X-Yandex-Suid-Status: 1 0,1 0
To: 15444 <at> debbugs.gnu.org, 456943@HIDDEN
From: Leon Meier <Leon.Meier@HIDDEN>
Message-ID: <caa708d0-b4ba-4d8c-66f9-075cf51c0a19@HIDDEN>
Date: Wed, 13 Jul 2016 23:23:20 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Icedove/45.1.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  As of today, the test case echo " 1234" | grep --color=auto
 '[1-9]' (80 spaces and 1234) still fails in (u)xterm. Any resolution in sight?
 [...] Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
 trust [77.88.31.22 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider
 (leon.meier[at]yandex.ru)
 1.8 MISSING_SUBJECT        Missing Subject: header
 0.2 NO_SUBJECT             Extra score for no subject
 0.0 T_DKIM_INVALID         DKIM-Signature header exists but is not valid
X-Debbugs-Envelope-To: 15444
X-Mailman-Approved-At: Wed, 13 Jul 2016 18:00:32 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  As of today, the test case echo " 1234" | grep --color=auto
    '[1-9]' (80 spaces and 1234) still fails in (u)xterm. Any resolution in sight?
    [...] 
 
 Content analysis details:   (1.3 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.7 RCVD_IN_DNSWL_LOW      RBL: Sender listed at http://www.dnswl.org/, low
                             trust
                             [77.88.31.22 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail provider
                             (leon.meier[at]yandex.ru)
  1.8 MISSING_SUBJECT        Missing Subject: header
  0.2 NO_SUBJECT             Extra score for no subject
  0.0 T_DKIM_INVALID         DKIM-Signature header exists but is not valid

As of today, the test case

echo " 
             1234" | grep --color=auto '[1-9]'
  (80 spaces and 1234)

still fails in (u)xterm. Any resolution in sight?

(Sorry for not providing any opinion of _how_ to resolve it technically 
at the moment; I'm not good enough for that. It is just the bug has been 
kind of disturbing me for a few years already...)




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; 5 Dec 2014 20:25:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 05 15:25:43 2014
Received: from localhost ([127.0.0.1]:54997 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XwzRf-0006xW-BG
	for submit <at> debbugs.gnu.org; Fri, 05 Dec 2014 15:25:43 -0500
Received: from mail-yk0-f170.google.com ([209.85.160.170]:50945)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <meyering@HIDDEN>) id 1XwzRc-0006xO-Ex
 for 15444 <at> debbugs.gnu.org; Fri, 05 Dec 2014 15:25:41 -0500
Received: by mail-yk0-f170.google.com with SMTP id q200so648912ykb.15
 for <15444 <at> debbugs.gnu.org>; Fri, 05 Dec 2014 12:25:39 -0800 (PST)
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:content-transfer-encoding;
 bh=4fI7ukys6cOdaKuqt/qdoN9gJVrbz7JG3So+bafYK+I=;
 b=p48OHYg+gO/5yg6r/2uR7pm4xN36IGlvZBRYHO49+j6gMySStXlFQNJUsNrk5/ZpUI
 gk7wtG/KISE2Dd+VDWE2e+YBVrTABtiOqty9/MUdIgOYa6mewsDbKpMEd1U9x6cS4zQP
 i/qkfOZzCn8kAvaqKcwYAYIo65BKunSfe8MfyD6ltdiOQrnid/0d4VXFh4uW/L7wfL8w
 4ycLzcSjISa1dMrPvLMfheUGHyFc6FPil+4sjZQQpEfQoYcnO4i+icSXShr3FnFtPkTb
 WMkbevfRuUyBVmplnS2GVspWlPQ3oMDp2xAQJOgCjLP8Z6FRf377FosEUSUj6BbqqRdz
 HtVA==
X-Received: by 10.170.160.137 with SMTP id b131mr17247528ykd.92.1417811139881; 
 Fri, 05 Dec 2014 12:25:39 -0800 (PST)
MIME-Version: 1.0
Received: by 10.170.139.67 with HTTP; Fri, 5 Dec 2014 12:25:19 -0800 (PST)
In-Reply-To: <20141205082551.GA4657@nomada>
References: <1237403814.574122.1379943245507.JavaMail.root@HIDDEN>
 <20141205082551.GA4657@nomada>
From: Jim Meyering <jim@HIDDEN>
Date: Fri, 5 Dec 2014 12:25:19 -0800
X-Google-Sender-Auth: 6msCIy2lJyYTPkeNKAynK38om-U
Message-ID: <CA+8g5KENnjW_0FZfxnNBW5CjJ+bPyv7XthsnSY=1fb7PbLCvLg@HIDDEN>
Subject: Re: bug#15444: [debian-reportbug@HIDDEN: Bug#734147: grep:
 colorisation corrupts character at end of line]
To: =?ISO-8859-1?Q?Santiago_Ruano_Rinc=F3n?= <santiago@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 15444
Cc: 15444 <at> debbugs.gnu.org, 734147-submitter@HIDDEN
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: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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 Fri, Dec 5, 2014 at 12:25 AM, Santiago Ruano Rinc=F3n
<santiago@HIDDEN> wrote:
> Hi,
>
> Forwarding some user's thoughts about this issue. Hope this helps to
> solve this bug.
>
> Regards,
>
> Santiago
>
> ----- Forwarded message from Marc Lehmann <debian-reportbug@HIDDEN> ---=
--
>
> Date: Fri, 05 Dec 2014 06:01:33 +0100
> From: Marc Lehmann <debian-reportbug@HIDDEN>,
> To: Debian Bug Tracking System <734147@HIDDEN>,
> Subject: Bug#734147: grep: colorisation corrupts character at end of line
> X-Mailer: reportbug 6.4.4
>
> Package: grep
> Version: 2.21-1
> Followup-For: Bug #734147
>
> Dear Maintainer,
>
> seeing that the bug is still in grep, here are some thoughts:
>
> Foremost, this is a bug in grep, but it is also a bug in xterm (and rxvt)=
,
> which claim to emulate vt102 behaviour, but both vt100 and vt102 behave
> like urxvt, namely space at the end of the line. At least, thats what the
> ROM image of either emulator does when run in a hardware simulator and fe=
d
> with the example.
>
> As for grep, you can currently choose between a) data corruption and b)
> annoying background colour bars IFF the user configures it.

Thank you for forwarding that.
However, note that there is another downside to making the
proposed change, not just "annoying background color bars...".

Currently, when grep matches a line containing a mix of
\r and \t bytes, it does what most expect/desire (with the
HT replacing each preexisting glyph with a space):

  $ printf 'asdfqwerzxcv\rASDF\tZXCV\n'|grep --color A
  ASDF    ZXCV

If we were to change grep so that it would no longer print
those offending \e[K codes, that same command would no
longer overwrite:

  $ printf 'asdfqwerzxcv\rASDF\tZXCV\n'|grep --color A
  ASDFqwerZXCV

I think the underlying issue is that we want grep's --color option
to be "safe", i.e., we want grep to stop conspiring with common
terminal emulators to mangle certain output lines.
Currently, it handles the \r...\t case at the expense of mangling
any match that begins in the rightmost column of your terminal.
The \r...\t issue is just one example of what can happen when
a tool prints arbitrary control sequences to a terminal, so
it feels like a red herring.  The mangling of real matches can
happen even with carefully sanitized input. That is more
problematic.

As such, I am leaning towards making the default be the
same as what setting "GREP_COLORS=3Dne" does now.

Opinions to the contrary?




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; 5 Dec 2014 08:26:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 05 03:26:10 2014
Received: from localhost ([127.0.0.1]:54246 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XwoDK-0001wt-2L
	for submit <at> debbugs.gnu.org; Fri, 05 Dec 2014 03:26:10 -0500
Received: from mx1.riseup.net ([198.252.153.129]:33263)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <santiago@HIDDEN>) id 1XwoDI-0001wk-3n
 for 15444 <at> debbugs.gnu.org; Fri, 05 Dec 2014 03:26:09 -0500
Received: from berryeater.riseup.net (berryeater-pn.riseup.net [10.0.1.120])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (Client CN "*.riseup.net",
 Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK))
 by mx1.riseup.net (Postfix) with ESMTPS id AE95A4136B;
 Fri,  5 Dec 2014 08:26:05 +0000 (UTC)
Received: from [127.0.0.1] (localhost [127.0.0.1])
 (Authenticated sender: santiagorr) with ESMTPSA id DDCB240DF3
Received: by nomada (sSMTP sendmail emulation); Fri, 05 Dec 2014 09:25:51 +0100
Date: Fri, 5 Dec 2014 09:25:51 +0100
From: Santiago Ruano =?iso-8859-1?Q?Rinc=F3n?= <santiago@HIDDEN>
To: 15444 <at> debbugs.gnu.org
Subject: [debian-reportbug@HIDDEN: Bug#734147: grep: colorisation corrupts
 character at end of line]
Message-ID: <20141205082551.GA4657@nomada>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Virus-Scanned: clamav-milter 0.98.4 at mx1
X-Virus-Status: Clean
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 15444
Cc: 734147-submitter@HIDDEN
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: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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.0 (/)

Hi,

Forwarding some user's thoughts about this issue. Hope this helps to
solve this bug.

Regards,

Santiago

----- Forwarded message from Marc Lehmann <debian-reportbug@HIDDEN> -----

Date: Fri, 05 Dec 2014 06:01:33 +0100
From: Marc Lehmann <debian-reportbug@HIDDEN>,
To: Debian Bug Tracking System <734147@HIDDEN>,
Subject: Bug#734147: grep: colorisation corrupts character at end of line
X-Mailer: reportbug 6.4.4

Package: grep
Version: 2.21-1
Followup-For: Bug #734147

Dear Maintainer,

seeing that the bug is still in grep, here are some thoughts:

Foremost, this is a bug in grep, but it is also a bug in xterm (and rxvt),
which claim to emulate vt102 behaviour, but both vt100 and vt102 behave
like urxvt, namely space at the end of the line. At least, thats what the
ROM image of either emulator does when run in a hardware simulator and fed
with the example.

As for grep, you can currently choose between a) data corruption and b)
annoying background colour bars IFF the user configures it.

The choice of "a) data corruption" over the alternatives is puzzling, as
the default settings of grep do not change the background colour, so the
"fix" (that corrupts the output) is entirely unnecessary when the goal is
just to change the text colour.

That is, setting "GREP_COLORS=ne" by default should always be safe unless
the user configured a backgorund colour change, or I am missing something
about the defaults.

Even if background colours were the default, there are a multitude of
workarounds that are all better than a) or b) above, for example, one
could output every character twice, once with the default bg + backspace +
character with coloured background. I don't know on which terminals this
might break, but unless your terminal is one line high, this should work
in vt10x emulators.

Another alternative would be to force a scroll before changing attributes
(move down/move up), which should give results visually indistinguishable
from the correct solution under all normal usage patterns.

I didn't think long about this problem, there might be even better
solutions.

So, in short, grep should simply change to sane defaults ("GREP_COLORS=ne",
leaving the problem to the user who configures his/her own GREP_COLORS),
or implement a suitable workaround (such as forcing a scroll with default
attributes).

Both of these would result in no data corruption. The first will result in
(presumably) ugly background colour changes if the user configures that,
the second should always work. Some experimentation might be in order, but
surely grep can do better than just corrupt the search results.


-- System Information:
Debian Release: 7.5
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'unstable'), (500, 'testing'), (500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16-3-amd64 (SMP w/12 CPU cores)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages grep depends on:
ii  dpkg          1.16.15
ii  install-info  4.13a.dfsg.1-10
ii  libc6         2.19-1
ii  libpcre3      1:8.31-5

grep recommends no packages.

grep suggests no packages.

-- no debconf information


----- End forwarded message -----




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; 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: Mon, 25 Mar 2024 15:45:02 UTC

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