Skip to content

Can't use custom themes that use ANSI colors #4236

@jason0x43

Description

@jason0x43

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

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