Package: grep
Version: 2.14-1
Severity: normal

Dear Maintainer,

When grep is asked to colorise matches (e.g. grep --color=tty), it outputs
an sgr sequence to switch to (e.g.) red text colour, followed by a clear
to end of screen.

(apparently, this is the patch that implements that: 
http://git.savannah.gnu.org/cgit/grep.git/commit/src/grep.c?id=1eb74b3a38f16192097fc1d51a9b219165c540aa)

The problem is that this corrupts the character before the match when the
match happens to be at the end of the line.

e.g. when grep prints "1234\e[1m\e[Kuuuu", in a terminal that has 4
columns, it expects the first line to be 1234, and the second be a
coloured uuuu:

   1234
   uuuu

However, the result in xterm is:

   123u
   uuu

While the result in urxvt is:

   123
   uuuu

i.e. in xterm a character is missing, in urxvt it gets cleared. this is
because the cursor is at the end of the line for the last character of the
line, so a clear to end of screen erases that character.

(apparently xterm and urxvt disagree on whether to clear the
cursor-past-margin flag, but they do agree that clearing to end of screen
clears from the visible cursor position onward).

-- System Information:
Debian Release: 7.1
  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.10-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.10
ii  install-info  4.13a.dfsg.1-10
ii  libc6         2.17-93

grep recommends no packages.

Versions of packages grep suggests:
ii  libpcre3  1:8.31-2

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to