This has been implemented in a bunch of terminals/apps already:
Most modern operating systems and desktop environments do support Dark and Light themes,
this includes at least MacOS, Windows, KDE Plasma, Gnome, and probably others.Some even support switching from dark to light and light to dark mode based on sun rise / sun set.
In order to not make the terminal emulator look bad after such switch, we must
enable the applications inside the terminal to detect when the terminal has
updated the color palette. This may happen either due to the operating system having
changed the current theme or simply because the user has explicitly requested to
reconfigure the currently used theme (e.g. because the user requested to change the terminal profile,
also containing a different color scheme).Ideally we are getting CLI tools like delta to query the theme mode before sending out RGB values
to the terminal to make the output look more in line with the rest of the desktop.But also TUIs like vim should be able to reflect dark/light mode changes as soon as the
desktop has changed to light/dark mode or the user has changed the terminal profile.
Describe the solution you'd like
Implement the feature for Vim, for the reference - Neovim implementation
Describe alternatives you've considered
There is vim-lumen but it was deprecated in favor of the solution above.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Can't you use the TermResponseAll request for this?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Sorry?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Well, you created the ticket here.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I hope @vimpostor will reply here.
If nothing is needed for the feature on Vim side, we should reflect that in the tracking table:
https://contour-terminal.org/vt-extensions/color-palette-update-notifications/#adoption-state
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Can't you use the TermResponseAll request for this?
No, the mechanism behind the t_RB and t_RF values from TermResponseAll is something completely different, which are the background color of the underlying terminal when requested by vim. It does not update during runtime, as the terminal can't send it to vim, rather vim has to request it.
The new VT extension from above instead uses another CSI code to query the system theme, which can only be a boolean indicating dark or light mode, not the actual background or foreground color.
By enabling unsolicited DSR, the terminal can also push system theme mode changes to vim at runtime.
This would need some small code changes in vim itself to work.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
This would need some small code changes in vim itself to work.
@vimpostor how about the patch?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()