Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem: Visual is unreadable if termguicolors is set #14025

Closed
wants to merge 1 commit into from

Conversation

habamax
Copy link
Contributor

@habamax habamax commented Feb 13, 2024

solution: Set Visual guifg to black(light) and lightgrey(dark)

Relates #14024

solution: Set Visual guifg to black(light) and lightgrey(dark)
@habamax
Copy link
Contributor Author

habamax commented Feb 13, 2024

set tgc bg=light

image

set tgc bg=dark

image

gui

image

gui and hi normal guibg=black guifg=white

image

@habamax
Copy link
Contributor Author

habamax commented Feb 13, 2024

gui, hi normal guibg=black guifg=white and set bg=dark

image

@habamax
Copy link
Contributor Author

habamax commented Feb 13, 2024

I don't know how to distinguish terminal + termguicolors vs pure gui so here guifg is set for both, which might annoy ppl using default gvim.

@chrisbra
Copy link
Member

so what exactly is the problem here? I tried in an ordinary xterm vim --clean -c ':set termguicolors' and it looks okay:
grafik

@habamax
Copy link
Contributor Author

habamax commented Feb 13, 2024

Try with another terminal that will fail detecting dark background (urxvt, windows terminal, simple terminal, konsole, gnome-terminal, etc).

You either in putty or xterm (putty is forcefully set to use dark background, xterm properly reports bg color with OSC and vim can detect that bg is dark).

@habamax
Copy link
Contributor Author

habamax commented Feb 13, 2024

Those are set to dark:

  • "linux" Linux console
  • "screen.linux" Linux console with screen
  • "cygwin.*" Cygwin shell
  • "putty.*" Putty program

The rest would depend on handle_osc and COLORFGBG env variable.

https://github.com/vim/vim/blob/master/src/term.c#L3212-L3244

@chrisbra
Copy link
Member

putty is my goto terminal, I don't see it there. I tried

  • terminator
  • xfce-terminal
  • the new Windows Terminal

I still cannot reproduce.

But I think the patch is good. Let's add some specific gui foreground color for Visual then.

@chrisbra chrisbra closed this in 34e4a05 Feb 14, 2024
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Feb 15, 2024
Problem:  Visual highlight hard to read with 'termguicolors'
          (Maxim Kim)
Solution: Set Visual GUI foreground to black (with background=light)
          and lightgrey (with background=dark)
          (Maxim Kim)

fixes: vim/vim#14024
closes: vim/vim#14025

vim/vim@34e4a05

Co-authored-by: Maxim Kim <habamax@gmail.com>
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Feb 15, 2024
Problem:  Visual highlight hard to read with 'termguicolors'
          (Maxim Kim)
Solution: Set Visual GUI foreground to black (with background=light)
          and lightgrey (with background=dark)
          (Maxim Kim)

fixes: vim/vim#14024
closes: vim/vim#14025

vim/vim@34e4a05

Co-authored-by: Maxim Kim <habamax@gmail.com>
nkouevda added a commit to nkouevda/vim-material that referenced this pull request Mar 7, 2024
vim/vim#14025 changed the default from `guifg=NONE` to
`guifg=LightGrey`, so we must now explicitly `guifg=NONE` in order to
unset it, so that syntax highlighting is preserved in visual mode.
nkouevda added a commit to nkouevda/vim-monokai that referenced this pull request Mar 7, 2024
vim/vim#14025 changed the default from `guifg=NONE` to
`guifg=LightGrey`, so we must now explicitly `guifg=NONE` in order to
unset it, so that syntax highlighting is preserved in visual mode.
glepnir pushed a commit to glepnir/neovim that referenced this pull request Mar 31, 2024
Problem:  Visual highlight hard to read with 'termguicolors'
          (Maxim Kim)
Solution: Set Visual GUI foreground to black (with background=light)
          and lightgrey (with background=dark)
          (Maxim Kim)

fixes: vim/vim#14024
closes: vim/vim#14025

vim/vim@34e4a05

Co-authored-by: Maxim Kim <habamax@gmail.com>
@habamax habamax deleted the visual-gui-termguicolors branch April 25, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants