Bug 143966 - Color patch causes corrupted output in 'less'
Color patch causes corrupted output in 'less'
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: less (Show other bugs)
3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Karsten Hopp
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-02 14:20 EST by Jordan Russell
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-04 11:58:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jordan Russell 2005-01-02 14:20:29 EST
Description of problem:
The patch that was applied to fix #138913 seems to have introduced a
new problem. The ESC[K sequences that the patch prints at the
beginning of every line cause display corruption in 'less -R' when
lines are wrapped.

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

How reproducible:
Always

Steps to Reproduce:
1. Create a file named "testfile" with the following 100-character line:

0.........1.........2.........3.........4.........5.........6.........7.........8.........9.........

2. Set your terminal width to 80.

3. Run:   grep --color=always '' testfile | less -R

4. Inside less, press '>' and '<' to jump to the end and beginning of
the file respectively.

Actual Results:  Following a press of '>' or '<', we don't see the
first 80 characters of the line anymore, just:

8.........9.........

Expected Results:  Expect to see:

0.........1.........2.........3.........4.........5.........6.........7.........
8.........9.........

Additional info:

If you run grep without "--color=always" the problem does not occur.
Stock grep (grep-2.5.1a.tar.bz2) also does not exhibit the problem.
Comment 1 Jordan Russell 2005-01-02 15:03:56 EST
(Oops, "beginning of every line" should be "at the end of every
matched string". It just so happens that in my example they're the same.)
Comment 2 Tim Waugh 2005-01-04 11:58:59 EST
I can't reproduce the problem here.  In any case, this is more a "less" problem
than a "grep" one -- and by the look of the man page you can add "K" to the
LESSANSIENDCHARS environment variable to work around it.
Comment 3 Jordan Russell 2005-01-04 13:08:34 EST
> I can't reproduce the problem here.

Hrmm, that's odd; I can reproduce it on 3 different machines and with 3 
different terminals - xterm, VGA console, and PuTTY.

> and by the look of the man page you can add "K" to the
> LESSANSIENDCHARS environment variable to work around it.

*Blushes*. Yeah, that appears to work. Could've sworn I tried that. Thanks.

Note You need to log in before you can comment on or make changes to this bug.