fix(main): prevent Neovim 0.12 TUI background autocmd removal on first colorscheme load#764
Open
guohao117 wants to merge 1 commit into
Open
fix(main): prevent Neovim 0.12 TUI background autocmd removal on first colorscheme load#764guohao117 wants to merge 1 commit into
guohao117 wants to merge 1 commit into
Conversation
…m TUI CSI 2031 term response autocmd neovim/neovim@d460928#diff-49225a49c226c2f1b36f966d0178c556e204cdc0b660c80db9e4568e03f6ef99R689 Neovim 0.12+ introduces TUI changes where setting 'background' during the first colorscheme load can remove the CSI 2031 term response autocmd, causing automatic background switching (dark/light) to stop working. This commit ensures 'background' is not set on initial load, preserving Neovim's background detection functionality.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
neovim/neovim@d460928#diff-49225a49c226c2f1b36f966d0178c556e204cdc0b660c80db9e4568e03f6ef99R689
In Neovim 0.12, when the terminal reports a light background, the initial colorscheme still explicitly set background=dark during setup. However, setting the background option at this stage triggers Neovim to remove its internal TermResponse AutoCommand, which is responsible for handling the CSI 2031 terminal response and automatic background switching.
As a result, Neovim loses the ability to automatically switch between dark and light backgrounds based on terminal feedback. This PR avoids setting the background option on the first colorscheme load, preserving Neovim's TermResponse AutoCommand and ensuring correct background detection and switching.
Related Issue(s)
Checklist