Skip to content

Text selection has poor contrast/readability on light terminals with certain themes #5295

Closed

Description

@ben-vargas

Description

When selecting text (mouse drag to copy) in the TUI on a light terminal, the selection highlighting has poor contrast making the selected text difficult or impossible to read. This affects the default opencode theme, as well as orng and likely others.

The root cause is that @opentui/core defaults to inverting foreground/background colors when no explicit selection colors are provided. This works well for dark themes (light text → light selection background with dark text), but produces poor results for light themes or themes with dark text colors (dark text → dark selection background with black/transparent foreground).

OpenCode version

1.0.137

Steps to reproduce

  1. Use a light terminal theme (or terminal with light background)
  2. Run opencode with the default opencode theme (also reproducible with orng and others)
  3. Have the AI generate a response with some text
  4. Try to select text by clicking and dragging to copy it
  5. Notice the selection is hard to read due to poor contrast

Screenshot and/or share link

Image Image

Operating System

macOS (likely affects all platforms)

Terminal

Ghostty

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 9, 2025
  2. github-actions commented on Dec 9, 2025

    @github-actions
    Contributor

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

    These issues also report contrast and readability problems with text selection highlighting in the TUI when using certain themes, particularly with light terminals or transparent backgrounds. Feel free to ignore if your specific case differs from these reports.

  3. ben-vargas commented on Dec 9, 2025

    @ben-vargas
    ContributorAuthor

    I had checked #4669 and #4666 noted above by github-actions bot but those seem to be about (slash) command highlighting rather than selecting text on the scrollback buffer components.

  4. self-assigned this
    on Dec 20, 2025
  5. kommander commented on Dec 20, 2025

    @kommander
    Contributor

    It needs to set proper text selection fg/bg colors and add these to the theme, as by default it currently just inverses the colors.

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

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions