Repository navigation
Improve terminal color support for NetBeans (256color palette, truecolor) - #9741
Open
matthiasblaesing wants to merge 2 commits into
Open
matthiasblaesing wants to merge 2 commits into
matthiasblaesing wants to merge 2 commits into
Conversation
mbien
reviewed
Oct 22, 2026
Comment on lines
+223
to
+227
| if (i.field == AttrEncoding.BGCOLOR) { | ||
| fgColorUpdated = null; | ||
| } else if (i.field == AttrEncoding.BGCOLOR) { | ||
| bgColorUpdated = null; | ||
| } |
Member
There was a problem hiding this comment.
something wrong here: both if check BG. First was probably meant for FG.
Member
|
Yes, looks a great improvement. Thanks! As a later step, and having spent a load of time last week fighting with the Output window, we might consider changes there and whether some of this attribute parsing code can be shared somewhere. Nit : Improve Terminal color support in the title would be good for future release notes. |
…and color palette mode Bumps TERM variable to xterm-256colors and reports COLORTERM as truecolor
matthiasblaesing
force-pushed
the
terminal_colors
branch
from
October 22, 2026 16:58
b9c9b50 to
867435b
Compare
Contributor
Author
|
@mbien your finding is correct (the code was wrong). The intention was here that when one of the indexed colors is used, the true color value should be discarded. @neilcsmith-net regarding the title. Yeah, in my mind the "terminal" was in that heading.... |
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.
The NetBeans terminal has only rudimentary support for setting colors. For many use-case this is enough but more complex applications assume support for larger color ranges. One such example is "opencode". In NetBeans it currently looks like this:
Checking the supplied color codes turned out, that opencode sends sequences in the form
\[38;2;<r>;<g>;<b>mand\[48;2;<r>;<g>;<b>m. These sequences carry 24bit color definitions.This PR implements support for the 24bit sequences and also the 256 color palette index variant (
\[38;5;<n>m,\[48;5;<n>m).With this applied opencode is rendered like this:
The palette codes can be demoed with
colortest-pythontool:Before:
After: