Skip to content

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

@ben-vargas

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

Metadata

Metadata

Assignees

No one assigned

    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