--- Begin Message ---
Subject: |
'ls' ignores term capabilities when generating color. |
Date: |
Thu, 28 Nov 2013 12:31:06 -0800 |
User-agent: |
Thunderbird |
I logged in on a *dumb* terminal
and did an 'ls'. Rather than a file list, I got:
\x1b[00;32mwpad.dat\x1b[0m*
\x1b[00mwpad_socks.dat\x1b[0m
\x1b[00mwuredir.xml\x1b[0m
\x1b[00mx.c\x1b[0m
\x1b[00mx.c.orig\x1b[0m
\x1b[00;32mx1\x1b[0m*
\x1b[00mxaml\x1b[0m
\x1b[01;35mxmision-web\x1b[0m/
\x1b[01;35mxrdp\x1b[0m/
\x1b[00mxrdp-sesadmin.log\x1b[0m
\x1b[00;32mxtree117.zip\x1b[0m*
\x1b[00;32mxtree2b-20050606.zip\x1b[0m*
\x1b[01;35mxx\x1b[0m/
\x1b[01;35mxxx\x1b[0m/
\x1b[00;32myast2.txt\x1b[0m*
\x1b[40;33;01mzero\x1b[0m
\x1b[01;35mzips\x1b[0m/
\x1b[01;35mztars\x1b[0m/
\x1b[01;35mztest\x1b[0m/
\x1b[00mzyppinst\x1b[0m
------------------
While I do have an alias that says:
alias ls='ls -CF --show-control-chars --color=always'
If the terminal HAS NO color capabilities, I would expect
it not to display anything where color was selected,
as the mapping for switching colors on a dumb terminal
is "".
I tried settings for "TERM":
of "none", "dumb", and "" (empty)
All gave the same strings as would be correct
for a 16-color terminal.
IMO, "ls" shouldn't print out "bogus" strings for color
that are not in the listed "TERM"inal's capabilties.
Wouldn't that be the wisest course of action? Or is
there a requirement, "poSomewhereIx" to print garbage strings
to terminals that don't have specific capabilities?
;-)
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#15992: 'ls' ignores term capabilities when generating color. |
Date: |
Thu, 17 Apr 2014 02:14:28 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 04/16/2014 07:21 PM, Bernhard Voelker wrote:
> On 04/16/2014 05:56 PM, Pádraig Brady wrote:
>> I've cleaned up the patch and added a test.
>> If you're Ok with it I'll push.
>
> Minor nit:
>
>> +++ b/tests/ls/color-term.sh
>> [...]
>> +# Don#t output colors
>
> s/Don#t/Don't/
>
> Otherwise +1.
>
> Thanks & have a nice day,
> Berny
>
Guilherme confirmed privately that adjustments are OK,
so pushing now.
thanks for the review,
Pádraig.
--- End Message ---