From 50aeb1f6dede1b1292c0e5d6fbfe49f49a85e9e1 Mon Sep 17 00:00:00 2001 From: kevans Date: Thu, 16 Aug 2018 01:18:20 +0000 Subject: [PATCH] Revert r337826: MFC of ls(1) COLORTERM honoring It was not ready, and was much-objected-to. --- bin/ls/ls.1 | 14 ++------------ bin/ls/ls.c | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index 71c2b43621d..16ad49b87c5 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -32,7 +32,7 @@ .\" @(#)ls.1 8.7 (Berkeley) 7/29/94 .\" $FreeBSD$ .\" -.Dd August 8, 2018 +.Dd December 1, 2015 .Dt LS 1 .Os .Sh NAME @@ -140,8 +140,6 @@ after each that is a Enable colorized output. This option is equivalent to defining .Ev CLICOLOR -or -.Ev COLORTERM in the environment. (See below.) This functionality can be compiled out by removing the definition of @@ -638,10 +636,6 @@ The variable still needs to reference a color capable terminal however otherwise it is not possible to determine which color sequences to use. -.It Ev COLORTERM -See description for -.Ev CLICOLOR -above. .It Ev COLUMNS If this variable contains a string representing a decimal integer, it is used as the @@ -666,9 +660,7 @@ for more information. .It Ev LSCOLORS The value of this variable describes what color to use for which attribute when colors are enabled with -.Ev CLICOLOR -or -.Ev COLORTERM . +.Ev CLICOLOR . This string is a concatenation of pairs of the format .Ar f Ns Ar b , where @@ -775,8 +767,6 @@ option for more details. .It Ev TERM The .Ev CLICOLOR -and -.Ev COLORTERM functionality depends on a terminal type with color capabilities. .It Ev TZ The timezone to use when displaying dates. diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 66c2fbb8279..91ef9ea4e15 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -374,7 +374,7 @@ main(int argc, char *argv[]) f_listdot = 1; /* Enabling of colours is conditional on the environment. */ - if ((getenv("CLICOLOR") || getenv("COLORTERM")) && + if (getenv("CLICOLOR") && (isatty(STDOUT_FILENO) || getenv("CLICOLOR_FORCE"))) #ifdef COLORLS if (tgetent(termcapbuf, getenv("TERM")) == 1) { -- 2.45.0