summaryrefslogtreecommitdiff
path: root/src/dircolors.hin
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2022-02-12 22:54:07 +0100
committerPádraig Brady <P@draigBrady.com>2022-02-15 17:01:19 +0000
commit75c9fc6740e93dba95f63a1e5e92bd5cf17f1743 (patch)
tree5695d5edf3e1296ebda8311b07c99fb9e2975931 /src/dircolors.hin
parent0b0f1965fba57f1c75d92e36ac3cbc0d58396810 (diff)
downloadcoreutils-75c9fc6740e93dba95f63a1e5e92bd5cf17f1743.tar.gz
dircolors: consider COLORTERM as well as TERM env vars
COLORTERM is an environment used usually to expose truecolor support in terminal emulators. Therefore support matches on that in addition to TERM. Also set the default COLORTERM match pattern so that we apply colors if COLORTERM is any value. This implicitly supports a terminal like "foot" without a need for an explicit TERM entry. * NEWS: Mention the new feature. * src/dircolors.c (main): Match COLORTERM like we do for TERM. * src/dircolors.hin: Add default config to match any COLORTERM. * tests/misc/dircolors.pl: Add test cases.
Diffstat (limited to 'src/dircolors.hin')
-rw-r--r--src/dircolors.hin10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/dircolors.hin b/src/dircolors.hin
index 0258cc067..673835201 100644
--- a/src/dircolors.hin
+++ b/src/dircolors.hin
@@ -8,8 +8,11 @@
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
-# Below are TERM entries, which can be a glob patterns, to match
-# against the TERM environment variable to determine if it is colorable.
+# Global config options can be specified before TERM or COLORTERM entries
+
+# Below are TERM or COLORTERM entries, which can be glob patterns, which
+# restrict following config to systems with matching environment variables.
+COLORTERM ?*
TERM Eterm
TERM ansi
TERM *color*
@@ -207,3 +210,6 @@ EXEC 01;32
.opus 00;36
.spx 00;36
.xspf 00;36
+
+# Subsequent TERM or COLORTERM entries, can be used to add / override
+# config specific to those matching environment variables.