mirror of
https://github.com/neovim/neovim.git
synced 2026-08-30 19:11:52 +00:00
fix(defaults): detect 'background'/'termguicolors' on UI attach #40175
Problem: Terminal background and truecolor detection runs only at startup,
gated on a UI being attached. A headless server has no UI then, so
`'background'` and `'termguicolors'` are never detected and remote
UIs ignore the terminal's theme.
Solution: Also (re)detect on UIEnter. The most recently attached terminal
wins; an explicit user value is preserved.
This commit is contained in:
@@ -368,7 +368,11 @@ local options = {
|
||||
desc = [=[
|
||||
When set to "dark" or "light", adjusts the default color groups for
|
||||
that background type. The |TUI| or other UI sets this on startup
|
||||
if it can detect the background color.
|
||||
if it can detect the background color, and re-detects it whenever a UI
|
||||
attaches later, unless 'background' was set explicitly. When multiple
|
||||
terminal UIs are attached they share one value, taken from whichever
|
||||
terminal reports its background last (which may not be the most
|
||||
recently attached one, since it depends on response speed).
|
||||
|
||||
This option does NOT change the background color, it tells Nvim what
|
||||
the "inherited" (terminal/GUI) background looks like.
|
||||
|
||||
Reference in New Issue
Block a user