Bug 138913

Summary: Line wrapping causes GREP_COLOR background color to "smear"
Product: [Fedora] Fedora Reporter: Eli <elicarter>
Component: grepAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.5.1-39 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-11-16 16:49:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eli 2004-11-11 22:01:35 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7)
Gecko/20040808 Firefox/0.9.3

Description of problem:
Running bash in an xterm with
GREP_COLOR='1;37;41'
GREP_OPTIONS=--color=auto

When the highlighted portion of a line wraps and causes the screen to
scroll by a line, the background of the full line is set to red (41).

For example, in an xterm, set GREP_COLOR and GREP_OPTIONS as above,
then press enter until your prompt is on the last line of the xterm. 
Then run:
grep 'expressions containing' /usr/share/doc/grep-2.5.1/*
The 'expressions containing' will split before 'containing', and the
line after "backreferencing" will have a red background.

Version-Release number of selected component (if applicable):
grep-2.5.1-26

How reproducible:
Always

Steps to Reproduce:
1. Open bash in an xterm
2. export GREP_COLOR='1;37;41'
3. export GREP_OPTIONS='--color=auto'
4. press <ENTER> until prompt is on the last line of the xterm
5. grep 'expressions containing' /usr/share/doc/grep-2.5.1/*
    

Actual Results:  The 'expressions containing' will split before
'containing', and the line after "backreferencing" will have a red
background.

Expected Results:  The 'expressions containing' will split before
'containing', and the line after "backreferencing" will not have a red
background.

Additional info:

Comment 2 Tim Waugh 2004-11-16 13:43:25 UTC
Filed upstream:
https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=11022

I've applied a patch submitted by Karsten Hopp, which seems to fix the
problem here at least.

Thanks for the report.

Comment 3 Bill Nottingham 2004-11-16 16:21:41 UTC
On builds of some packages with this grep installed, we're seeing
failures like:

/usr/sbin/setfiles -q -c policy.18 file_contexts/file_contexts
/usr/sbin/setfiles:  line number 2 is missing fields (only read [K)

or:

objdump:
'.[K/usr/src/build/484679-i386/install/usr/lib/valgrind/libpthread.so':
No such file
objdump:
'.[K/usr/src/build/484679-i386/install/usr/lib/valgrind/libpthread.so.0':
No such file
objdump:
'.[K/usr/src/build/484679-i386/install/usr/lib/valgrind/vg_inject.so':
No such file

Comment 4 Tim Waugh 2004-11-16 16:49:20 UTC
Sorry.  Fixed in grep-2.5.1-39.