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: Paul Jackson <pj <at> usa.net>
To: 15444 <at> debbugs.gnu.org
Subject: bug#15444: (no subject)
Date: Fri, 15 Jul 2016 00:17:52 -0500
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 <at> usa.net




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.