Repository navigation
Improve terminal color support for NetBeans (256color palette, truecolor) - #9741
matthiasblaesing wants to merge 2 commits into
Conversation
| if (i.field == AttrEncoding.BGCOLOR) { | ||
| fgColorUpdated = null; | ||
| } else if (i.field == AttrEncoding.BGCOLOR) { | ||
| bgColorUpdated = null; | ||
| } |
There was a problem hiding this comment.
something wrong here: both if check BG. First was probably meant for FG.
|
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
b9c9b50 to
867435b
Compare
|
@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.... |
jtulach
left a comment
There was a problem hiding this comment.
Looking forward to see the colors in NetBeans terminal!
| } | ||
| processBuilder.getEnvironment().put("TERM", IOEmulation.getEmulation(descriptor.inputOutput)); // NOI18N | ||
| // This is a hack - this should also come from the IOEmulation | ||
| processBuilder.getEnvironment().put("COLORTERM", "truecolor"); // NOI18N |
There was a problem hiding this comment.
- Is there a way to test NetBeans terminal supports
truecolor? - e.g. run some ASCII sequences and then capture
java.awt.Imageof the terminal - and verify the requested colors are there?
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: