opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Can't use custom themes that use ANSI colors

Open jason0x43 opened this issue 2 months ago • 10 comments

Description

Trying to load a theme that uses ANSI colors causes opencode to error.

TypeError: undefined is not an object (evaluating 'c3[mode2]')
    at resolveColor (src/cli/cmd/tui/context/theme.tsx:64:25)
    at <anonymous> (src/cli/cmd/tui/context/theme.tsx:67:18)
    at map (native:1:11)
    at resolveTheme (src/cli/cmd/tui/context/theme.tsx:66:57)
    at runComputation (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:742:22)
    at updateComputation (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:724:3)
    at readSignal (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:660:67)
    at get (src/cli/cmd/tui/context/theme.tsx:106:18)
    at <anonymous> (src/cli/cmd/tui/app.tsx:531:17)
    at runComputation (../../node_modules/.bun/[email protected]/node_modules/solid-js/dist/dev.js:742:22)...

OpenCode version

1.0.61

Steps to reproduce

  1. Create a custom theme using the my-theme.json example
  2. Change one of the color definitions to be a palette number, like "nord9": 9,.
  3. Set the custom theme as the default in the opencode config
  4. Start opencode and see error

Screenshot and/or share link

No response

Operating System

macOS 26.1

Terminal

kitty

jason0x43 avatar Nov 12 '25 04:11 jason0x43