GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(tui): add system dark/light mode matching by jal-co · Pull Request #9719 · anomalyco/opencode

Conversation

@jal-co

@jal-co jal-co commented Jan 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Summary

Adds an option to automatically sync TUI theme mode with OS appearance.

Resolves #9697

Demo:

CleanShot.2026-01-20.at.15.03.26.mp4

Changes

  • Add getOSDarkMode() function for cross-platform OS dark mode detection:
    • macOS: defaults read -g AppleInterfaceStyle
    • Windows: Registry query for AppsUseLightTheme
    • Linux: GNOME/KDE detection with terminal fallback
  • Add "Match system dark/light mode" toggle command in System category
  • Poll OS appearance every 3 seconds when enabled
  • Persist setting to kv.json as auto_mode_enabled (off by default)

Implementation Notes

  • Opt-in by default - feature is disabled until user explicitly enables it
  • Dynamic command title - shows "Stop matching..." when enabled
  • Works with any theme that has light/dark variants (e.g., github, catppuccin, rosepine)
  • The special system theme derives colors from terminal palette, so light/dark switching doesn't apply to it

Testing Checklist

  • macOS: Tested dark/light mode switching
  • Windows: Verify registry query works correctly
  • Linux (GNOME): Verify gsettings detection works
  • Linux (KDE): Verify kreadconfig5 detection works

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

earthslasthope, ariane-emory, antonio-ivanovski, nixypanda, hugodemenez, janglad, kkugot, and chuxubank reacted with thumbs up emoji
All reactions
  • 👍 8 reactions
@github-actions

github-actions Bot commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

Related PR:

  • feat(tui): add appearance setting with dark/light/system modes #7182 - feat(tui): add appearance setting with dark/light/system modes

This PR appears to be addressing similar functionality for TUI appearance/theme mode management. It may be implementing a related or overlapping feature for system dark/light mode support. You should review this PR to understand if it's a duplicate or if these PRs address different aspects of the same feature.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jal-co added 2 commits January 20, 2026 15:18
@jal-co
feat(tui): add system dark/light mode matching
e50f77b
Add option to automatically sync TUI theme mode with OS appearance.
Polls OS dark mode setting every 3 seconds when enabled.

- Add getOSDarkMode() for cross-platform detection (macOS, Windows, Linux)
- Add 'Match system dark/light mode' toggle in command list
- Persist setting to kv.json as auto_mode_enabled (off by default)

Closes #9697
@jal-co
fix: random formatting change in app.tsx
8256065
@github-actions github-actions Bot mentioned this pull request Jan 25, 2026
feat(opencode): support light appearance for all catppuccin themes #10513
Closed
@thdxr
thdxr force-pushed the dev branch from cbab81f to 2d3c7a0 Compare January 30, 2026 04:49
@opencode-agent
opencode-agent Bot force-pushed the dev branch from 00637c0 to 71e0ba2 Compare January 30, 2026 14:32
@thdxr
thdxr force-pushed the dev branch 3 times, most recently from f1ae801 to 08fa7f7 Compare January 30, 2026 14:37
@disrupted

disrupted commented Feb 6, 2026

Copy link
Copy Markdown

commenting on this because I would really like to see this feature too. there is however a new standardised way to get the terminal appearance. https://github.com/contour-terminal/contour/blob/master/docs/vt-extensions/color-palette-update-notifications.md#adoption-state
It uses the new CSI ? 996 n query which works cross-platform on supported terminal emulators.

hugodemenez reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugodemenez hugodemenez mentioned this pull request Feb 7, 2026
[FEATURE]: Light/Dark mode auto-switching #9697
Closed
1 task done
@hugodemenez

hugodemenez commented Feb 7, 2026

Copy link
Copy Markdown

Hi @justinlevinedotme!

I was searching for a performant and elegant way to solve this issue.

Your solution #9719 works great!

I would like to raise a question: I am not sure polling for the system theme every 3 seconds is really performant.

Isn’t there a better way? Can’t we listen to the system preferences directly, like we do with media queries on the web?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugodemenez

hugodemenez commented Feb 7, 2026

Copy link
Copy Markdown

Looks like #7182 is trying to achieve the same feature with 2s polling longer

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@disrupted

disrupted commented Feb 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

polling is definitely not the preferred way to implement this. instead we should enable DSR (device status report) messages for color palette updates. the link I shared in my previous comment explains this. then we are subscribed to notifications for when the appearance changes and can act directly

hugodemenez and thibmeu reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugodemenez

hugodemenez commented Feb 7, 2026

Copy link
Copy Markdown

@disrupted did you try implementing this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@disrupted

disrupted commented Feb 7, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

I think it would require some sort of feedback on this topic from the maintainers before starting actual work on it. this repo is currently getting flooded by PRs without prior planning (most of these will never get merged). I would not want to invest effort into this before a green light

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jal-co

jal-co commented Feb 8, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Author

I think it would require some sort of feedback on this topic from the maintainers before starting actual work on it. this repo is currently getting flooded by PRs without prior planning (most of these will never get merged). I would not want to invest effort into this before a green light

100%, polling is used in other parts of app, so that's why I used it here.

I also was trying to not add too much to the app, using existing systems where possible.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kavhnr kavhnr mentioned this pull request Feb 12, 2026
feat(tui): add Mode 2031 theme detection with tri-state appearance mode #13233
Closed
@github-actions github-actions Bot mentioned this pull request Feb 21, 2026
feat(config): add theme mode override option #14558
Closed
3 of 6 tasks
@kavhnr kavhnr mentioned this pull request Feb 25, 2026
feat(tui): add Mode 2031 theme detection with tri-state appearance mode #15089
Closed
4 of 6 tasks
@Saafo

Saafo commented Mar 28, 2026

Copy link
Copy Markdown

Any updates? Expected to be merged!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Apr 9, 2026
feat(tui): add auto theme mode that follows system/terminal theme #21611
Closed
3 of 6 tasks
@opencode-agent
opencode-agent Bot force-pushed the dev branch from 2f2ed11 to 9f201d6 Compare April 16, 2026 21:55
@jal-co jal-co closed this by deleting the head repository May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Light/Dark mode auto-switching

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@jal-co @disrupted @hugodemenez @Saafo
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.