When termguicolors is set changing background option does not update terminal colors. Terminal colors are however updated if termguicolors is off.
Environment (please complete the following information):
8.2.2805—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
After setting 'background' you may have to reload your color scheme. Depends on whether the color scheme sets 'background' or takes the current value and adjusts to it.
Your reproduction instructions are incomplete, "a colour scheme" is not specific enough, "change background option" doesn't say what it's set to.
The colour scheme I am using is does not require to reload the colours after
changing 'baground' option. Windows with normal buffers change their
background, but not the terminal window.
Another way to reproduce it is to use two different colour schemes, e.g.
vim -u NONE --clean and then
:terminal bash
:set termguicolors
:color blue
The background color of the terminal window does not change, but it does change
when 'termguicolors' is not set.
I noticed that when 'termguicolors' is set the 'Terminal' highlight group is ignored.
This issue is not really about color scheme / background option. It's about "Normal" color not being re-applied to terminal windows. A simple way to reproduce this issue:
gvim --clean
:term
<C-W>:hi Normal guibg=Blue
Now only a regular window becames "blue", while terminal retains (white) background.
To be fair, :h terminal-size-color says that:
To use a different color the Terminal highlight group can be used, for example:
hi Terminal ctermbg=lightgrey ctermfg=blue guibg=lightgrey guifg=blue
The highlight needs to be defined before the terminal is created. Doing it
later, or setting 'wincolor', will only have effect when the program running
in the terminal displays text or clears the terminal.
So it's maybe kind of expected, but nonetheless it's very inconvenient.
To make things worse, not only "Normal" stops working, but also wincolor relies on external app being able to output specific terminal codes that is not always the case. For example, a terminal running standard Windows cmd will probably never switch to new wincolor no matter how many clear and echo one executes.