bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a fix for color ls with wrapped lines.


From: Alexander V. Lukyanov
Subject: a fix for color ls with wrapped lines.
Date: Tue, 14 Oct 2008 12:43:11 +0400
User-agent: Mutt/1.5.11

Hello, bug-coreutils!

There is a problem with color ls when a background color is used and the line
wraps. It leads to complete new line erased with the background on "bce" 
terminals.
(One may argue that rxvt behaves differently, but there are many other bce 
terminals)

One fix is to clear to end-of-line after turning off the color. Here is a patch
that does it.

--- ls.c.1      2008-10-14 12:24:39.605050000 +0400
+++ ls.c        2008-10-14 12:25:48.985396400 +0400
@@ -538,7 +538,7 @@
   {
     { LEN_STR_PAIR ("\033[") },                /* lc: Left of color sequence */
     { LEN_STR_PAIR ("m") },            /* rc: Right of color sequence */
-    { 0, NULL },                       /* ec: End color (replaces lc+no+rc) */
+    { LEN_STR_PAIR ("\033[m\033[K") }, /* ec: End color (replaces lc+no+rc) */
     { LEN_STR_PAIR ("0") },            /* rs: Reset to ordinary colors */
     { 0, NULL },                       /* no: Normal */
     { 0, NULL },                       /* fi: File: default */

-- 
   Alexander.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]