coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] dircolors: consider COLORTERM sufficient for color


From: Pádraig Brady
Subject: Re: [PATCH] dircolors: consider COLORTERM sufficient for color
Date: Mon, 14 Feb 2022 17:40:42 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Thunderbird/97.0

On 12/02/2022 21:54, Arsen Arsenović wrote:
COLORTERM is an environment used usually to expose truecolor support in
terminal emulators. If a terminal emulator supports truecolor, it is
surely reasonable to assume it also supports 8/16/256 colors.

This implicitly supports foot, alacritty and any other truecolor
terminal emulator with unmatched $TERM.
---
Good evening,

I've noticed dircolors does not work in foot and alacritty, and on previously
raised patches about adding a TERM entry for them the concern of a nongeneric
solution was brought up. This is a valid concern, and as many terminals
(including these two) export COLORTERM to advertise 24-bit color support, it'd
appear to be a good way to pick up on color support.

COLORTERM does seem to be a way to advertise truecolor support:
https://gitlab.com/gnachman/iterm2/-/issues/5294

Note dircolors supports config files for multiple terminals like:

  global config
  ...
  TERM should_not_match
  specific config
  ...
  TERM should_match
  ...

Your change could break this setup if there were
entries in "specific config" that weren't overridden later,
and even if they were, it would result in larger LS_COLORS env vars.

How about the attached patch to allow matching COLORTERM
just like TERM, and set the pattern in the default config
to match against any COLORTERM value.
This also has the advantage of handling specific COLORTERM values.
We would have to add the default COLORTERM entry to distro config
(when supported by the installed dircolors), but that should be easy enough to 
do.

I've also attached a patch to avoid needless calls to fnmatch().

cheers,
Pádraig

Attachment: 0002-dircolors-speed-up-processing-of-TERM-entries.patch
Description: Text Data

Attachment: 0001-dircolors-consider-COLORTERM-as-well-as-TERM-env-var.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]