Subject: bug#15992: closed (Re: bug#15992: 'ls' ignores term capabilities when generating color.)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 17 Apr 2014 01:15:03 +0000

Your bug report

#15992: 'ls' ignores term capabilities when generating color.

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
15992: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15992
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#15992: 'ls' ignores term capabilities when generating color.
From: Pádraig Brady <[email-masked]>
To: Bernhard Voelker <[email-masked]>
Cc: Guilherme de Almeida Suckevicz <[email-masked]>, [email-masked]
Date: Thu, 17 Apr 2014 02:14:28 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

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.

Subject: 'ls' ignores term capabilities when generating color.
From: Linda Walsh <[email-masked]>
To: [email-masked]
Date: Thu, 28 Nov 2013 12:31:06 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

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?

;-)