[FEATURE]: Light/Dark mode auto-switching #6984

Open
opened 2026-02-16 18:05:49 -05:00 by yindo · 3 comments
Owner

Originally created by @samholmes on GitHub (Jan 20, 2026).

Originally assigned to: @rekram1-node on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

I use a NightOwl app on macOS to switch between light/dark mode throughout the day. So far, all my apps support dynamically switching including Ghostty and Neovim (with the help of this plugin https://github.com/f-person/auto-dark-mode.nvim). But OC doesn't. Is it possible to have light/dark mode themes selected which are switched in real-time? The desktop app has this, but not the TUI.

Originally created by @samholmes on GitHub (Jan 20, 2026). Originally assigned to: @rekram1-node on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request I use a NightOwl app on macOS to switch between light/dark mode throughout the day. So far, all my apps support dynamically switching including Ghostty and Neovim (with the help of this plugin https://github.com/f-person/auto-dark-mode.nvim). But OC doesn't. Is it possible to have light/dark mode themes selected which are switched in real-time? The desktop app has this, but not the TUI.
yindo added the opentuidiscussion labels 2026-02-16 18:05:49 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 20, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #3244: Different theme for light and dark mode - requests the ability to use different themes based on system settings, which is closely related to your auto-switching feature request.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 20, 2026): This issue might be a duplicate of existing issues. Please check: - #3244: Different theme for light and dark mode - requests the ability to use different themes based on system settings, which is closely related to your auto-switching feature request. Feel free to ignore if none of these address your specific case.
Author
Owner

@justinlevinedotme commented on GitHub (Jan 20, 2026):

Hey, I'm happy to take this, as it is something I'd like too.

Proposed approach:

  1. Add an "auto" option to the TUI theme mode (alongside "dark" / "light")
  2. When set to "auto", detect OS appearance and listen for changes:
  • macOS: Use defaults read -g AppleInterfaceStyle or the dark-mode-listener npm package
  • Linux: Check $XDG_CURRENT_DESKTOP + gsettings or similar
  • Windows: Registry check for AppsUseLightTheme
  1. Store the user's preference (auto/dark/light) in KV storage
  2. Update theme reactively when OS appearance changes

edit:
maybe do something like this instead?

Current: theme is a single string (e.g., "dracula"). Mode is detected once at startup from terminal background.

Proposed config schema:

// Simple (backwards compatible)
{ "theme": "dracula" }
// Advanced (new)
{
  "theme": {
    "light": "github",
    "dark": "dracula", 
    "mode": "auto"  // "auto" | "light" | "dark"
  }
}

When mode: "auto", detect OS appearance and switch between light/dark themes automatically.

Questions:

  • Should "auto" be the default, or should users opt-in?
  • Should this be something added to the config options? alongside separate "dark" and "light" themes? This would also handle #3244
  • Any concerns with adding a dependency like dark-mode-listener, or prefer a shell-based approach?
@justinlevinedotme commented on GitHub (Jan 20, 2026): > Hey, I'm happy to take this, as it is something I'd like too. > > **Proposed approach:** > 1. Add an "auto" option to the TUI theme mode (alongside "dark" / "light") > 2. When set to "auto", detect OS appearance and listen for changes: > - macOS: Use defaults read -g AppleInterfaceStyle or the `dark-mode-listener` npm package > - Linux: Check $XDG_CURRENT_DESKTOP + gsettings or similar > - Windows: Registry check for AppsUseLightTheme > 3. Store the user's preference (auto/dark/light) in KV storage > 4. Update theme reactively when OS appearance changes > > --- **edit:** maybe do something like this instead? **Current:** theme is a single string (e.g., "dracula"). Mode is detected once at startup from terminal background. **Proposed config schema:** ```jsonc // Simple (backwards compatible) { "theme": "dracula" } // Advanced (new) { "theme": { "light": "github", "dark": "dracula", "mode": "auto" // "auto" | "light" | "dark" } } ``` When mode: "auto", detect OS appearance and switch between light/dark themes automatically. **Questions:** - Should "auto" be the default, or should users opt-in? - Should this be something added to the config options? alongside separate "dark" and "light" themes? This would also handle #3244 - Any concerns with adding a dependency like dark-mode-listener, or prefer a shell-based approach?
Author
Owner

@ariane-emory commented on GitHub (Jan 20, 2026):

@justinlevinedotme I think it should be opt-in, off by default.

Personally, I would suggest that instead of changing the shape/schema of the configuration file, the enabledness of the automatic switching mode (on or off/true or false) be toggled by a new menu item in the command_list menu and persisted to the kv.json file. There are numerous pre-existing toggleable items in the command_list menu whose implementations can serve as examples.

@ariane-emory commented on GitHub (Jan 20, 2026): @justinlevinedotme I think it should be opt-in, off by default. Personally, I would suggest that instead of changing the shape/schema of the configuration file, the enabledness of the automatic switching mode (on or off/true or false) be toggled by a new menu item in the `command_list` menu and persisted to the `kv.json` file. There are numerous pre-existing toggleable items in the `command_list` menu whose implementations can serve as examples.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6984