ANSI themes with 0 in color definitions don't work #3271

Closed
opened 2026-02-16 17:39:27 -05:00 by yindo · 2 comments
Owner

Originally created by @jason0x43 on GitHub (Dec 2, 2025).

Description

If a theme uses 0 in a definition, opencode crashes.

{
  "defs": {
    "black": 0
  },
  "theme": {
    "text": "black"
  }
}

OpenCode version

1.0.128

Steps to reproduce

  1. Create a theme using 0 for a color definition
  2. Use the defined color in the theme
  3. Select the theme in opencode

Screenshot and/or share link

No response

Operating System

macOS 26.1

Terminal

kitty

Originally created by @jason0x43 on GitHub (Dec 2, 2025). ### Description If a theme uses `0` in a definition, opencode crashes. ```json { "defs": { "black": 0 }, "theme": { "text": "black" } } ``` ### OpenCode version 1.0.128 ### Steps to reproduce 1. Create a theme using 0 for a color definition 2. Use the defined color in the theme 3. Select the theme in opencode ### Screenshot and/or share link _No response_ ### Operating System macOS 26.1 ### Terminal kitty
yindo added the opentuibug labels 2026-02-16 17:39:27 -05:00
yindo closed this issue 2026-02-16 17:39:27 -05:00
Author
Owner

@jason0x43 commented on GitHub (Dec 2, 2025):

Fix in #5009

@jason0x43 commented on GitHub (Dec 2, 2025): Fix in #5009
Author
Owner

@github-actions[bot] commented on GitHub (Dec 2, 2025):

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

  • #4236: Can't use custom themes that use ANSI colors
  • #4429: Crash when using theme with ANSI color indexes (terminal palette numbers)

Both issues describe the same problem where using numeric ANSI color definitions (including 0) in theme defs causes crashes with similar error patterns. Feel free to ignore if your specific case differs from these.

@github-actions[bot] commented on GitHub (Dec 2, 2025): This issue might be a duplicate of existing issues. Please check: - #4236: Can't use custom themes that use ANSI colors - #4429: Crash when using theme with ANSI color indexes (terminal palette numbers) Both issues describe the same problem where using numeric ANSI color definitions (including 0) in theme defs causes crashes with similar error patterns. Feel free to ignore if your specific case differs from these.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3271