bug-ncurses
[Top][All Lists]
Advanced

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

Re: What is the best way to handle LS_COLORS ?


From: Tim Allen
Subject: Re: What is the best way to handle LS_COLORS ?
Date: Sat, 28 Mar 2020 11:58:29 +1100

On Fri, Mar 27, 2020 at 02:48:20PM -0500, Bryan Christ wrote:
> I need advice as to handle LS_COLORS. IMO, it's an absolute nightmare.
> Instead of using SGR 38:2 and 48:2 variants (which allow you know
> what the desired color is) it use SGR 38:5 and 48:5 which indicate a
> specific color number.

So far as I can tell, `dircolors --print-database` defaults only include
codes in the ranges 0-1, 30-37, 40-47, not 38 or 48 -- but I guess
that's still indicating colours by palette entry, rather than by RGB.

> It seems the fundamental problem is that LS_COLORS takes advantage of
> information known only to the terminal and whoever specified the color
> values. Am I missing something here?

dircolors, like many many other applications, is just assuming the
standard xterm 256-color palette, in the same way that applications
assume the first 8 colours will be black, red, green, etc. and that the
next 8 colours will be bright versions. Even today, some terminals (like
stock tmux, and Konsole) don't allow applications to modify the palette,
so it's much more portable to use the standard palette than to try to
set a custom colour.


Tim.



reply via email to

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