You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This one isn't a big problem as long as a theme can be configured that uses terminal color codes instead of hex colors, but I suggest making the default theme use terminal color codes instead of hex colors.
I find it's a better user experience to open a TUI that automatically blends in with the terminal, instead of imposing its own theme. I know it's more difficult and limiting to make a theme using terminal color codes that looks good with most themes, but I do think it's worth the effort. More complex themes with hex codes can be provided as an option; I just find it jarring to open a TUI and have a dramatically different color scheme immediately take over.
Custom full-color themes make for great for screenshots, but are annoying when you actually use the tool and it doesn't match your configured color scheme.
Claude Code isn't perfect with this, but at least it uses the terminal background and foreground colors instead of imposing its own.
i do enjoy the approach you're describing, we went that direction with the terminal.shop tui. that said, for opencode the idea was to take cues from something like neovim (alt screen, themed background colors, etc). in fact, i view opencode as slowly replacing more and more of my time spent in nvim. so the plan today is to stick with a full TUI experience but we do acknowledge that we're only lightly taking advantage of that fact today, and we're not opposed to changing our mind at some point.
you'll be able to define custom themes using 0-255 ansi color codes, of which 0-15 are your terminals user defined color scheme. i'll try to add support in the next couple of days!
Reacted by Net, kohane27, Nico Baier, graelo and Yukai Huang
so, we do now support custom themes and you can define the colors as 0-15 ansi codes. but, i might need someone to play with that to help me come up with a good default "system" theme in opencode. if i use 0 for the background, for instance, it still isn't transparent. i know how to drop the background TUI wide, but is that what's desired (no background vs ansi color 0)? and what about the rest of the colors? is using the 0-15 color range what people are interested in?
For creating a theme that uses the terminal colors that works with a broad range of terminal themes, I would stick to these (admittedly limiting) guidelines:
Don't set a background color, except for specific UI elements like a status bar. Just use the terminal's default background.
Only use the terminal's default foreground \033[39m, default background \033[49m, and color codes 1-6.
The reason for this is there's a lot of variation between themes in whether 0 (white) and 8 (black) are:
0—always black; 8—always white
0—black for dark themes, white for light themes; 8—white for dark themes, black for light themes
0—white for dark themes, black for light themes; 8—black for dark themes, white for light themes
Similarly, there's no standard on how the bright variants (8-15) should be treated on dark vs light themes, and some themes like Solarized even map them to completely different UI colors (like different shades of gray).
I would also consider avoiding using 3 (yellow) for text for the same reason (little consistency in whether it's a readable color).
You can reverse colors using \033[7m, which will use the background color for the foreground and vice-versa (and can be combined with other foreground colors), and which gives a readable result for most themes and colors and let's you use the terminal's configured background color as a foreground color.
If you want to make something that will be the default theme, you might allow yourself to ignore some of those guidelines, or pull in hex colors in some places that look good in most light and dark themes, given that it can be difficult to create something that looks amazing with all those limitations and anything that isn't compatible with a user's terminal theme can be fixed in configuration. (E.g., Claude Code uses Anthropic's orange in some places and I think it looks fine in a lot of both light and dark themes. I think a lot of purple shades can look good in a lot of light and dark themes, and I think you can even pick grays for inactive border-type elements that will look good in most light and dark themes.)
That said, if anyone can create something that looks good with all those limitations, it's you!
unfortunately, it wasn't that simple in bubbletea/lipgloss v2, but i got it working with a less-than-ideal implementation; @net let me know what you think about #419 (available in latest release)
@adamdotdevin that appears to fix it for color codes 0-15, but it's still broken for 16-255. I'm guessing this check here needs be changed to 0-255. Most modern terminals support configuring colors 0-255, and I use codes 16-20 in my theme for colors like "diff added background," "diff removed background," etc.
@paralin do you mind opening a new issue for vterm in emacs (or is there one already?), i'd like to download those and troubleshoot but can't right this moment and don't want to forget
@adamdotdevin that appears to fix it for color codes 0-15, but it's still broken for 16-255. I'm guessing this check here needs be changed to 0-255. Most modern terminals support configuring colors 0-255, and I use codes 16-20 in my theme for colors like "diff added background," "diff removed background," etc.
no, this was just a missunderstanding on my part, didn't know terminals allowed customizing 16-255. i'll address this, it's a little more work than just that check, have to build up the map as well
@net the tui is currently being rewritten with opentui, some theme stuff may be fixed there but that is kinda the blocker, not a whole lot of work will be done to the go tui in the meantime unless there is a large bug
Hopefully in next iteration of tui we can close this out for you!
Hi @rekram1-node, I'm using OpenCode version 1.0.209. The built-in theme is nice, but when I use Ghostty the colors appear quite dark. Is there a way to adjust the theme colors? Thanks!
Activity
adamdotdevin commentedon Jun 15, 2025
i do enjoy the approach you're describing, we went that direction with the terminal.shop tui. that said, for opencode the idea was to take cues from something like neovim (alt screen, themed background colors, etc). in fact, i view opencode as slowly replacing more and more of my time spent in nvim. so the plan today is to stick with a full TUI experience but we do acknowledge that we're only lightly taking advantage of that fact today, and we're not opposed to changing our mind at some point.
net commentedon Jun 16, 2025
In that case how would I create a user theme that uses terminal colors instead of hex colors? Right now it seems like themes have to be compiled in?
I use neovim, but my neovim theme uses terminal color codes so that colors adapt automatically to system color scheme changes.
adamdotdevin commentedon Jun 17, 2025
you'll be able to define custom themes using 0-255 ansi color codes, of which 0-15 are your terminals user defined color scheme. i'll try to add support in the next couple of days!
paralin commentedon Jun 22, 2025
@adamdotdevin Using with vterm in emacs, we need a "no-theme" option which is just transparent and uses the editor colors.
Here's how it looks currently:
adamdotdevin commentedon Jun 23, 2025
so, we do now support custom themes and you can define the colors as 0-15 ansi codes. but, i might need someone to play with that to help me come up with a good default "system" theme in opencode. if i use 0 for the background, for instance, it still isn't transparent. i know how to drop the background TUI wide, but is that what's desired (no background vs ansi color 0)? and what about the rest of the colors? is using the 0-15 color range what people are interested in?
https://opencode.ai/docs/themes/
net commentedon Jun 23, 2025
For creating a theme that uses the terminal colors that works with a broad range of terminal themes, I would stick to these (admittedly limiting) guidelines:
\033[39m, default background\033[49m, and color codes 1-6.\033[7m, which will use the background color for the foreground and vice-versa (and can be combined with other foreground colors), and which gives a readable result for most themes and colors and let's you use the terminal's configured background color as a foreground color.net commentedon Jun 23, 2025
If you want to make something that will be the default theme, you might allow yourself to ignore some of those guidelines, or pull in hex colors in some places that look good in most light and dark themes, given that it can be difficult to create something that looks amazing with all those limitations and anything that isn't compatible with a user's terminal theme can be fixed in configuration. (E.g., Claude Code uses Anthropic's orange in some places and I think it looks fine in a lot of both light and dark themes. I think a lot of purple shades can look good in a lot of light and dark themes, and I think you can even pick grays for inactive border-type elements that will look good in most light and dark themes.)
That said, if anyone can create something that looks good with all those limitations, it's you!
net commentedon Jun 23, 2025
FWIW, personally I plan to just make my own theme using ansi codes that works specifically for my configured terminal colors.
adamdotdevin commentedon Jun 23, 2025
if you do, i'd love to see a screenshot for inspiration!
net commentedon Jun 25, 2025
@adamdotdevin looks like the 0-255 ansi codes in opencode aren't using the terminal's configured colors for those codes.
jjui, which also uses lipgloss, had a similar issue that was fixed here https://github.com/idursun/jjui/pull/106/files.
net commentedon Jun 25, 2025
(Also however you did it last time here worked correctly #19)
adamdotdevin commentedon Jun 26, 2025
unfortunately, it wasn't that simple in bubbletea/lipgloss v2, but i got it working with a less-than-ideal implementation; @net let me know what you think about #419 (available in latest release)
net commentedon Jun 26, 2025
@adamdotdevin that appears to fix it for color codes 0-15, but it's still broken for 16-255. I'm guessing this check here needs be changed to 0-255. Most modern terminals support configuring colors 0-255, and I use codes 16-20 in my theme for colors like "diff added background," "diff removed background," etc.
2 remaining items
paralin commentedon Jun 26, 2025
@adamdotdevin here is how it looks in emacs vterm now. much better, there are still some stray blue underscore characters though.
adamdotdevin commentedon Jun 26, 2025
@paralin do you mind opening a new issue for vterm in emacs (or is there one already?), i'd like to download those and troubleshoot but can't right this moment and don't want to forget
paralin commentedon Jun 26, 2025
sure #431
net commentedon Oct 14, 2025
@adamdotdevin or @thdxr any idea how to fix this?
rekram1-node commentedon Oct 14, 2025
@net the tui is currently being rewritten with
opentui, some theme stuff may be fixed there but that is kinda the blocker, not a whole lot of work will be done to the go tui in the meantime unless there is a large bugHopefully in next iteration of tui we can close this out for you!
net commentedon Oct 14, 2025
@rekram1-node great to hear! 🤞🏼 that finally fixes this!
BitCalSaul commentedon Dec 30, 2025
Hi @rekram1-node, I'm using OpenCode version 1.0.209. The built-in theme is nice, but when I use Ghostty the colors appear quite dark. Is there a way to adjust the theme colors? Thanks!
docs(memory): implement multi-memory chunking for remory token limits (…
fix(security): prevent path traversal via symlinks in File.read and F…
thdxr commentedon Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
feat(nix): add additive bun2nix packaging path for opencode
feat(nix): promote bun2nix packaging to default opencode attribute
fix(settings): make MCP management reachable from the Settings dialog (…