Skip to content

tui: markdown list text keeps old theme color after light/dark switch #55735

Description

@uloco

Description

When I switch between light and dark color mode while opencode is running, the plain text in markdown list items keeps the old theme's color. Bold and inline code update fine, so in dark mode the list text ends up dark grey on dark and is hard to read. Same thing happens going dark to light. In the screenshots below you can see that also the list indicators like "-" are affected as well.
Switching to another tab / session and back fixes it, also restarting opencode.

Maybe also other elements are affected but this is the most prominent one for me and I encounter it daily.

Plugins

No response

OpenCode version

v2.0.29

Steps to reproduce

  1. open opencode
  2. say "print a markdown list of three fruits"
  3. see theme
  4. switch theme color mode to opposite
  5. markdown list item fg color is broken

Screenshot and/or share link

theme is "opencode"

  • light (correct)
Image
  • dark (broken)
Image
  • dark (how it should be)
Image

Operating System

macOS 27.0.1 (26A434)

Terminal

Ghostty

Activity

  1. uloco commented on Oct 15, 2026

    @uloco
    Author

    looks like table cells are also affected:

    Image
  2. opencode-agent commented on Oct 15, 2026

    @opencode-agent
    Contributor

    Thanks for the clear report and screenshots. I reproduced this on v2.0.29, and it still happens on the latest dev (81200db).

    Steps: start with the opencode theme in light mode, get a reply containing a markdown list, then switch to dark mode. Plain text and the - markers in the list items keep their light-mode colors (dark grey on dark), while bold, inline code and normal paragraphs update. The recording and screenshots below show it, and the script below reproduces it. Switching the session/tab and back still works around it, as you noted.

    recording.mp4

    Screenshot

    Screenshot

    Reproduction script (drive.ts)
    import { Effect } from "effect"
    import { Llm, OpenCodeDriver } from "opencode-drive"
    
    // Repro for #55735: markdown list text keeps the old theme color after a light/dark switch.
    export default OpenCodeDriver.use(
      {
        ...(process.env.OC_DEV ? { opencode: { dev: process.env.OC_DEV } } : {}),
        tui: { recording: true },
        tuiConfig: { theme: { name: "opencode", mode: "light" }, keybinds: { "theme.switch_mode": "ctrl+y" } },
      },
      ({ ui, llm }) =>
        Effect.gen(function* () {
          yield* llm.queue(
            Llm.text("Here are three fruits:\n\n- Apple is **red** and `crisp`\n- Banana is yellow\n- Cherry is small\n\nPlain paragraph text after the list."),
          )
          yield* ui.submit("print a markdown list of three fruits")
          yield* ui.waitFor("Plain paragraph text")
          yield* Effect.sleep(1000)
          yield* ui.screenshot("1-light")
          // theme.switch_mode is bound to ctrl+y above (same as the "Switch to dark mode" command)
          yield* ui.press("y", { ctrl: true })
          yield* Effect.sleep(1500)
          yield* ui.screenshot("2-dark-after-switch")
          yield* ui.press("y", { ctrl: true })
          yield* Effect.sleep(1500)
          yield* ui.screenshot("3-light-again")
        }),
    )

    Run it with opencode-drive: opencode-drive run ./drive.ts. It drives opencode from your PATH; set OC_DEV to the path of an OpenCode checkout to run that from source instead.

  3. Finn763 commented on Oct 16, 2026

    @Finn763
    Contributor

    Taking this one. Markdown list runs keep their old theme color after a light/dark switch while other inline styles update, so the list path holds a stale style/binding — I'll find the stale binding in the TUI markdown/theme pipeline and pin it with a test.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions