Skip to content

Conversation

@jason0x43
Copy link
Contributor

@jason0x43 jason0x43 commented Dec 3, 2025

The theme handling code currently breaks when a color definition uses the ANSI value 0, like:

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

This PR updates the color definition lookup code to handle 0, which it currently treats as falsey.

Fixes #5010

Copilot AI review requested due to automatic review settings December 3, 2025 04:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the theme color resolution logic where ANSI color value 0 (representing black) was incorrectly treated as falsy and ignored. The fix updates the conditional check from a truthy check to an explicit null check, allowing 0 to be properly recognized as a valid color definition value.

Key Changes:

  • Fixed falsy value handling in color definition lookup to support ANSI color value 0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rekram1-node
Copy link
Collaborator

nice find thx

@rekram1-node rekram1-node merged commit f2fd0f8 into anomalyco:dev Dec 3, 2025
9 checks passed
spmurrayzzz pushed a commit to spmurrayzzz/opencode that referenced this pull request Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ANSI themes with 0 in color definitions don't work

2 participants