mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 13:06:00 +03:00
[GH-ISSUE #513] Automatically adapt appearance (light/dark) to that of the system #135
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#135
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ccjmne on GitHub (Jan 11, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/513
Hey folks,
I'd like to have OpenCode look bright during the day and dark at night.
I already played around with similar features in Ghostty, tmux, Neovim and I monkey-patched the code base tonight, I can attest to its fairly straightforward, and even simple feasibility.
However, there's still a few other topics I haven't begun considering:
My idea
My plan would be to emit a
CSIsequence? 2031 hwhen this "automatic appearance toggle" mechanism would be turned on, and listed for theDECSET,DECRSTstatus reports through997. It's what modern terminal emulators, multiplexers and TUIs use.A short and clear overview of the principles that go into implementing such support (as well as a table outlining the adoption state across the most prominent terminal tools) is available at https://contour-terminal.org/vt-extensions/color-palette-update-notifications.
TL;DR:
I implemented some proof of concept on my end, which works splendidly; now I'm thinking of contributing upstream and figured, from the first line of the
CONTRIBUTINGguidelines, that I should start a conversation here before anything.So here it goes: what do you think? If we want it, I'll get started with making it work and making it configurable.
@kommander commented on GitHub (Jan 12, 2026):
2031is general color scheme updates, right? Interminal.zigit already tries to detect that capability. I would activate/deactivate it there inenableDetectedFeaturesandresetStaterespectively. Inrenderer.tsI would then add an input handler when it is supported, which can emit acolor-sheme-changedevent or something similar. It can then fetch bg/fg terminal palette colors and check if they flipped, to additionally emit and dark/light mode event.If you have a better idea, go for it. Happy to bring this in.
@ccjmne commented on GitHub (Jan 21, 2026):
Hey @kommander,
I am dealing with some personal emergency and haven't spent any more time looking into this, but I still firmly intend to put something together in some near future.
I think it can be even simpler than what you're describing, in the sense that we could, by "subscribing" to the colour scheme updates, to the
CSIpattern997used to denote specifically whether the environment is indarkorlightmode, so we wouldn't even have to implement any sort of heuristic to determine what constitutes a "dark" palette.In any case, I just wanted to let you know that I haven't yet quite disappeared (well, I have, but not forever) and to thank you for your interest and support!