Skip to content

Fix light mode #17935

Closed as not planned
Closed as not planned

Description

@marcmorente

Description

Code examples are invisible when using a terminal in light mode and selecting text puts all in black.

Plugins

None

OpenCode version

1.2.27

Steps to reproduce

  1. Open a terminal, change colors to use light theme.
  2. Ask to the agen for some code examples.

Screenshot and/or share link

Image
Image

Operating System

Pop!_OS 22.04 LTS

Terminal

gnome terminal

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Mar 17, 2026
  2. github-actions commented on Mar 17, 2026

    @github-actions
    Contributor

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

    If your issue is not covered by any of the above, please clarify how it differs. Otherwise, consider adding a reaction or comment on the existing issue instead.

  3. van-sprundel commented on Mar 19, 2026

    @van-sprundel

    bump

    For some reason the formatted sections do not render well in light mode. on-select is dark and the text itself is not visible.

    Image

    on select:

    Image
  4. van-sprundel commented on Mar 19, 2026

    @van-sprundel

    Seems that this would be a one-liner fix

    diff --git a/packages/opencode/src/cli/cmd/tui/context/theme.tsx b/packages/opencode/src/cli/cmd/tui/context/theme.tsx
    index 2320c08cc..1354a2a47 100644
    --- a/packages/opencode/src/cli/cmd/tui/context/theme.tsx
    +++ b/packages/opencode/src/cli/cmd/tui/context/theme.tsx
    @@ -934,6 +934,7 @@ function getSyntaxRules(theme: Theme) {
         {
           scope: ["markup.raw", "markup.raw.block"],
           style: {
    +       background: theme.backgroundElement,
             foreground: theme.markdownCode,
           },
         },

    this worked for me locally

    Image
  5. removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  6. nb5p commented on May 30, 2026

    @nb5p

    I'm hitting the same issue with Ghostty using the Tango Light theme.

  7. amelvil2-ford commented on Jun 25, 2026

    @amelvil2-ford

    It seems like this might be an intermittent problem with how opencode (or opentui?) renders markdown code blocks. The fix suggested by the PR doesn't seem to work -- it seems like the foreground color is sometimes white too.

  8. van-sprundel commented on Jun 25, 2026

    @van-sprundel

    Yes, but making the background the correct color would make the white text visible

  9. amelvil2-ford commented on Jun 25, 2026

    @amelvil2-ford

    From what I saw, it seemed like both the foreground and background colors were white in some cases on MacOS, even with this fix.

  10. github-actions commented on Aug 25, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions