vim / colorschemes

colorschemes for Vim
279 stars 23 forks source link

Some incorrect background colors with some 16c colorschemes #150

Closed gdupras closed 2 years ago

gdupras commented 2 years ago

The following screenshots were obtained on Windows 10 in cmd.exe.

Steps:

  1. vim --clean colors\blue.vim
  2. :source colors\blue.vim (or some other colorscheme)
  3. :terminal

blue.vim

blue

delek.vim

delek

morning.vim

morning

peachpuff.vim

peachpuff

shine.vim

shine

habamax commented 2 years ago
  1. black background is the limitation of cmd.exe and bold (I am not sure we can do anything here, tbh, other than removing bold completely from all t_Cos)
  2. red bg I don't understand -- colorscheme uses Terminal linked to Normal...

PS, I haven't spotted it cause I forcefully set t_Co=256 in my configuration for win32

habamax commented 2 years ago

red bg... I am not sure if we can fix this in vim/colorschemes sub-project:

vim-term-colors

habamax commented 2 years ago

@chrisbra what do you think about red/blue inversion of colors in console vim with 16c ?

Should we think about workarounds or believe it might be fixed sometimes in the future in vim (if this is bug at all)?

chrisbra commented 2 years ago

I would guess this is clearly a bug

chrisbra commented 2 years ago

does it change with 256colors?

chrisbra commented 2 years ago

interesting :hi Terminal shows the correct colors.

habamax commented 2 years ago

does it change with 256colors?

It doesn't at all if I use ctermbg but does change if I use guibg: vim-term-colors2

habamax commented 2 years ago

@chrisbra it is not only red/blue, but also cyan/yellow

chrisbra commented 2 years ago

that is interesting. especially if you throw in https://github.com/vim/vim/issues/9498 (e.g. after :set termguicolors, :set notermguicolors) you would need to start specifying the gui attributes for the terminal 🤦‍♂️

Wow, how brocken...

romainl commented 2 years ago

FWIW, the red/blue-cyan/yellow switches in the windows console is the reason why we use color names for 16c cterm*g.

With the default palette, using 1 gives you a dark blue instead of the expected dark red but using darkred gives you the expected dark red.

Capture d’écran 2022-02-22 à 21 24 25

That screenshot with the red background makes me think that we may have a conflict of hacks.

romainl commented 2 years ago

@habamax I only have access to an older W10 machine where I can't install the Window console, sorry.

habamax commented 2 years ago

I only have access to an older W10 machine where I can't install the Window console, sorry.

The issue is with regular cmd.exe not new windows terminal. Although I have changed palette colors for it: image

But they are essentially the same (red id reddish, cyan is cyanish etc)

habamax commented 2 years ago
gdupras commented 2 years ago

I've reported the issue upstream.

gdupras commented 2 years ago

Users should be suggested to use set t_Co=256 or set termguicolors in their vimrcs

Where would that suggestion be? I suspect most people will never see it.

habamax commented 2 years ago

@gdupras this is not an option now, we're removing bold from tui versions of the colorschemes

https://github.com/vim/colorschemes/pull/152

habamax commented 2 years ago

Fixed in https://github.com/vim/vim/issues/9836