Open neersighted opened 5 years ago
Thank you for the feedback!
How would this work? There is no fixed specification for those 16 colors, right? We wouldn't have any control over how the output looks like.
a terminal with a set color scheme locally, and rely on true color for unconfigured terminals or over ssh.
I don't quite understand. What does "terminal over ssh" mean? Aren't you still limited by your local terminal if you SSH anywhere else?
There's no fixed specification, but most color schemes have a version for 16 color terminals. I'd prefer to have a pair of [rgb, 16-color index]
in each theme, thus falling back to a configured terminal.
There are situations where I cannot rely on truecolor, such as SSH from mobile devices, or connections over mosh. I find it useful to fall back to a conventional colorscheme instead of corrupting the terminal.
There's no fixed specification, but most color schemes have a version for 16 color terminals.
Ok, that makes sense. Although we would have to rely on the users to have the same color scheme configured in their terminal (which they need anyway for a suitable background color).
There are situations where I cannot rely on truecolor, such as SSH from mobile devices, or connections over mosh. I find it useful to fall back to a conventional colorscheme instead of corrupting the terminal.
Oh I see, if you are connecting to your machine from another terminal.
How would we detect that? Can we get correct values of $COLORTERM
/$TERM
within an SSH session?
The proper way is to use terminfo (try tput colors
on a system with modern ncurses and TERM set to xterm-direct
, for instance). Personally, I'd prefer to have it configured via a flag, so I can attach my own logic to the process.
(Making the color mode tri-state and adding a 4-bit mode would be perfect)
Also, themes could have automatic fallback support if they used the standard ANSI color names for 16 of their keys: black, red, green, blue, cyan, magenta, yellow, white (and bright variants of each)
I would also like to see this since I wanted to use the default color of the terminal rather than the colors specified manually.
Yes I would like this feature too. I think all we would need is a way to refer to a ansi colors in the theme format. Right now it seems we can only refer to "fixed" colors like
colors:
background_color: '161821'
If we could to something like
colors:
background_color: -1
white: 1
red: 2
then we could ship a theme that would only use the ansi colors.
+1 on this feature, with the addition that I'd like to be able to use a 256 colour palette, not just a 16 colour palette. Rationale being that I use a base16 theme in "compatible" mode (ie. using 22 colours), and I'd love if my LS_COLORS could respect my terminal colours, also e.g. when I switch theme.
A fallback to 16 colors would be great for those of us who use a terminal with a set color scheme locally, and rely on true color for unconfigured terminals or over ssh.