Support mode 2031 dark/light mode detection#14356
Conversation
|
Tested! Works with |
book/src/themes.md
Outdated
| dark = "catppuccin_frappe" | ||
| light = "catppuccin_latte" | ||
| # Optional. Defaults to the theme set for `dark` if not specified. | ||
| # no-preference = "catppuccin_frappe" |
There was a problem hiding this comment.
Just a NIT: the option no_preference, while it makes total sense in the code, may be confusing for the user (i.e. why would I set my theme to not have a preference?). What do you think of using something like default or fallback instead?
There was a problem hiding this comment.
It's borrowed from Kitty's naming https://sw.kovidgoyal.net/kitty/kittens/themes/#change-color-themes-automatically-when-the-os-switches-between-light-and-dark
fallback does sound nicer to me though
7b4f90e to
6e1d670
Compare
cor
left a comment
There was a problem hiding this comment.
I've been running this for a week and it works flawlessly!
Very nice UX improvement
6e1d670 to
7e28d62
Compare
7e28d62 to
7e9e773
Compare
|
Hey, I tested this using a Helix build from source and Ghostty on macOS, but Helix seems to always default to the dark theme regardless of my system appearance settings. Helix config ( [theme]
dark = "catppuccin_frappe"
light = "catppuccin_latte"Ghostty config: theme = dark:Catppuccin Frappe, light:Catppuccin LatteIn Ghostty, the theme correctly switches when toggling the system appearance, but Helix always uses the dark theme regardless of the system setting. |
|
@Nico-Mayer look at #14534 |
Fixes #13281.
For better compatibility in detection we can also look at querying OSC 11 for the terminal's background color and trying to detect its perceived lightness (also see #12238). That will take a bit more work to add OSC 11 to Termina and then to handle the response.