> > > For the value 7, ctermfg and ctermbg gives different colors. 'ctermfg=7'
> > > gives non-bold white, which is expected. But 'ctermbg=7' gives bold
> > > Black color. I'm assuming there is a if-conditional somewhere that's
> > > causing this distinction. If so, where is the conditional in the source
> > > code? If not, why is this happening?
> >
> > Color support depends on the terminal. Background and foreground
> > settings are often different, especially with older terminals and a low
> > number of colors supported. Sometimes the "bold" flag changes the color
> > between a darker and lighter color. You can find some information at
> > ":help highlight-ctermfg".
>
> I shouldn't have said "bold black." That caused unnecessary confusion.
> The 'cterm=' value is NONE. I was just trying to say "darker" shade of
> black.
>
> > > P.S. I'm on Windows. I have a Linux laptop but haven't checked if this
> > > behavior is reproducible on that OS.
>
> I checked on my Linux laptop. These are the behaviors:
>
> highlight | Linux | Windows
> ------------+---------------+-------------
> ctermfg=0 | Black | Black
> ctermfg=7 | White | Black
> ctermfg=8 | Bright black | Bright black
> ctermfg=15 | Bright white | Bright white
So what is the number of colors, set with the t_Co option in each case?
> I run Windows Terminal on Windows and Suckless Terminal on Linux. The
> colors in my WT are set in a JSON file, with 16 keys.
Not sure what this means. Do you manually specify colors for the
Windows Terminal? Obviously Vim cannot know what these colors are.
For "ctermfg-7" the color should probably "grey", neither white or
black. "Bright white" is just white, nothing is brighter than that.
"Bright black" is some kind of grey.
> But the colors in
> my ST is a C array of strings, and the indices match with Vim's behavior
> of 'ctermfg=<index>', i.e., 'ctermfg=0' is black and 'ctermfg=8' brblack
> (that's how it's named in the comments in ST's source code [1]).
I don't understand any of this. If this is about a terminal with 8 or
16 colors, better follow the standard colors. Vim will not be able to
handle any manually configured colors.
> The fun part is: I ssh'd into my Linux laptop from my Windows laptop.
What do you set $TERM to then? I doubt a Linux system has any specific
terminfo/termcap entry for that. I don't even know what ssh command
would be able to make a connection from a Windows Terminal. I've used
Putty (with varying success) and the Secure Shell built into Chrome,
which works quite well.
> Meaning, I ran Vim on the Linux machine but in WT. There, 'ctermfg=7'
> still showed White, unlike the Vim on native Windows. Seems like WT
> does show 'ctermfg=7' as white, but the 'builtin_win32' term isn't
> supplying WT with proper whatchamacallit. (I'm probably wrong. This was
> just a guess.)
The 'builtin_win32" entry predates Windows Terminal by many years, it
was made for the Windows console, and not for use with ssh. I don't
know what best to use for Windows Terminal, it has been under
development for quite a long time. Not sure if it can be considered
"stable" now. And I have no idea what to expect from an ssh command
running in Windows Terminal. What would it set $TERM to? What ssh
command is even available for this?
--
For society, it's probably a good thing that engineers value function over
appearance. For example, you wouldn't want engineers to build nuclear power
plants that only _look_ like they would keep all the radiation inside.