Hi, does anyone remembers or knows about the algorithm being used to detect dark/light background of terminal?
https://github.com/vim/vim/blob/fef66301665027f1801a18d796f74584666f41ef/src/term.c#L6287-L6295
https://github.com/vim/vim/blob/fef66301665027f1801a18d796f74584666f41ef/src/term.c#L5776-L5776
It looks like nowadays it "almost always" incorrectly detects light background for terminals with black background color.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
https://stackoverflow.com/questions/2507337/how-to-determine-a-terminals-background-color
—
Reply to this email directly, view it on GitHub,.
You are receiving this because you are subscribed to this thread.![]()
On windows terminal using WSL debian handle_osc is never called.
There is however term_bg_default function, I wonder if it is feasible to invert condition to default to dark background, assuming most of the terminals are dark?
https://github.com/vim/vim/blob/de7f5bde6c598d4da4ce5b30328eb458962ba60a/src/term.c#L3212-L3245
—
Reply to this email directly, view it on GitHub,.
You are receiving this because you are subscribed to this thread.![]()
I have inverted it, and this might be a BREAKING change: #13977
—
Reply to this email directly, view it on GitHub,.
You are receiving this because you are subscribed to this thread.![]()
I was quite interested in this myself. I found this commit from neovim. There is an escape sequence that lets you support this. Should be called OSC. Also you might be interested in this issue that tracked some issues related to the feature.
—
Reply to this email directly, view it on GitHub,.
You are receiving this because you are subscribed to this thread.![]()
Should be called OSC
Vim has it. The thing is, vim defaults to 'light' background and checks for the terminal OSC response which might fail/be incorrect.
To add to it, more than 1000 screendump tests are relying on background=light, and a lot of people got used to it.
—
Reply to this email directly, view it on GitHub,.
You are receiving this because you are subscribed to this thread.![]()
and a lot of people got used to it.
Who exactly? I see one person complaining in the PR but thats it.
—
Reply to this email directly, view it on GitHub,.
You are receiving this because you are subscribed to this thread.![]()
There were on libera #vim
—
Reply to this email directly, view it on GitHub,.
You are receiving this because you are subscribed to this thread.![]()
But PR is there for anyone to continue the journey.
—
Reply to this email directly, view it on GitHub,.
You are receiving this because you are subscribed to this thread.![]()