]> git.ipfire.org Git - thirdparty/coreutils.git/commit
ls: don't output colors with unknown TERM env variable
authorGuilherme de Almeida Suckevicz <guito.linux@gmail.com>
Wed, 16 Apr 2014 15:38:49 +0000 (16:38 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 17 Apr 2014 01:16:04 +0000 (02:16 +0100)
commit08783f100f511b010d040d6119c107cc0d5bc5fc
tree15a436cea6ba502ccdfe3493450766771209619f
parent943f3592ca10caaee7b991078f33a4e0f985a2f8
ls: don't output colors with unknown TERM env variable

--colors controls whether to output colors depending on
whether we're connected to a terminal or not, while this
change gives control over which terminals we output colors to.

* NEWS: Mention the change in behavior.
* src/ls.c (known_term_type): A new function to search the static
list from dircolors.h
(parse_ls_colors): Honor the TERM when both LS_COLORS and COLORTERM
are non empty.
* tests/ls/color-term.sh: A new test.
* tests/local.mk: Reference the new test.
Fixes http://bugs.gnu.org/15992
NEWS
src/ls.c
tests/local.mk
tests/ls/color-term.sh [new file with mode: 0755]