Skip to content

Support mode 2031 dark/light mode detection#14356

Merged
the-mikedavis merged 1 commit intomasterfrom
mode-2031
Sep 21, 2025
Merged

Support mode 2031 dark/light mode detection#14356
the-mikedavis merged 1 commit intomasterfrom
mode-2031

Conversation

@the-mikedavis
Copy link
Member

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.

@the-mikedavis the-mikedavis added the A-theme Area: Theme and appearence related label Aug 31, 2025
@colemickens
Copy link

Tested! Works with ghostty!

dark = "catppuccin_frappe"
light = "catppuccin_latte"
# Optional. Defaults to the theme set for `dark` if not specified.
# no-preference = "catppuccin_frappe"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@cor cor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been running this for a week and it works flawlessly!

Very nice UX improvement

@the-mikedavis the-mikedavis merged commit 23a647a into master Sep 21, 2025
7 checks passed
@the-mikedavis the-mikedavis deleted the mode-2031 branch September 21, 2025 15:41
littleblack111 pushed a commit to littleblack111/helix that referenced this pull request Sep 29, 2025
@Nico-Mayer
Copy link

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 (config.toml):

[theme]
dark = "catppuccin_frappe"
light = "catppuccin_latte"

Ghostty config:

theme = dark:Catppuccin Frappe, light:Catppuccin Latte

In Ghostty, the theme correctly switches when toggling the system appearance, but Helix always uses the dark theme regardless of the system setting.

@loralb
Copy link

loralb commented Oct 17, 2025

@Nico-Mayer look at #14534

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-theme Area: Theme and appearence related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support mode 2031 dark/light mode detection

5 participants