feat: support ANSI color indices in theme configuration#771
Merged
dlvhdr merged 3 commits intodlvhdr:mainfrom Feb 13, 2026
Merged
feat: support ANSI color indices in theme configuration#771dlvhdr merged 3 commits intodlvhdr:mainfrom
dlvhdr merged 3 commits intodlvhdr:mainfrom
Conversation
The theme config validation only accepted hex colors (#RGB / #RRGGBB) via the built-in hexcolor validator, even though the default theme already uses ANSI indices like "013" and "008" internally. This relaxes validation to also accept ANSI color indices (0-255), letting users reference terminal palette colors directly in their config. Closes dlvhdr#770
Contributor
Author
|
I just saw the lint issue, on it! |
Contributor
Author
|
@dlvhdr Hi, I think there's a CI issue with the docker workflow. It looks unrelated to my PR. |
Owner
|
Yeah it's unrelated. Still need to review the code 🙏 |
dlvhdr
reviewed
Feb 13, 2026
Owner
dlvhdr
left a comment
There was a problem hiding this comment.
looks great! just a minor comment
| description: >- | ||
| Specifies the color for text on an inverted background. Must be a valid hex color, | ||
| like `#a3c` or `#aa33cc`. | ||
| Specifies the color for text on an inverted background. Must be a valid hex color |
Owner
There was a problem hiding this comment.
we also need to update docs/src/content/docs/configuration/theme.mdx
Contributor
Author
There was a problem hiding this comment.
Oops, thanks, I had missed it. I just pushed a commit for this.
dlvhdr
approved these changes
Feb 13, 2026
Contributor
Author
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello again, thanks for your kind message in #770.
Here's my PR. I tested it by
go build -o gh-dash .and moving the binary to~/.local/share/gh/extensions/gh-dash/and then runninggh dash, with the config file below.In a nutshell, this PR replaces the
hexcolorvalidator with a customcolorvalidator that accepts both hex and ansi (0-255) formats. It's a strictly additive change — all previously valid configs remain valid.Config file and screenshot:
Details
`~/.config/gh-dash/config.yml`Changes
HexColortype toColorand swapped the built-inhexcolortag for a customcolorvalidator that accepts hex colors or numeric ANSI indices (0–255)_shimHexhelper intheme.goto_shimColor(pure rename, no logic change — lipgloss already handles both formats)"256","-1", leading zeros, etc.)Closes #770