Open cowwoc opened 7 years ago
Sorry, I meant Netbeans supports 16 colors, not 16-bit colors. I believe they only support the basic 8 color palette in "normal" or "bright" mode.
Sure. Any idea how to detect Netbeans ?
Good question. I don't think there is a way, so I guess we are forced to set extra system properties that will tell JANSI to assume the use of 16 colors. I assume this is possible?
It already exists: -Djansi.passthrough=true
should let ansi sequences through.
But don't you have to specify what ANSI mode is supported? Some terminals support 8 colors, others 16 colors, others 256 colors and others 16 million colors. If I enabled passthrough, which mode will get used?
-Djansi.passthrough=true is not working in Netbeans 8.2 with maven 3.5.3, just tried
just tried with Netbeans 8.2 and 9.0 beta on Linux: running "java -jar jansi-1.17.1.jar" in Netbeans terminal (Window > IDE Tools > Terminal) perfectly displays colors "mvn -v" also displays colors
which version of Netbeans on which OS does not display colors?
@peterremote1980, adding -Djansi.passthrough=true
to MAVEN_OPTS
actually does work (at least on CentOS 7), but breaks general Maven output handling. Now text like [INFO] NETBEANS-ExecEvent:{"type":"ForkSucceeded"}
appears in the output, collapsing of folds does not work any more and the build can not be resumed from the last failure. But that looks more like NetBeans problems TBH ...
@rkraneis i added this to .bashrc, but not working :-) Thanks anyway
export MAVEN_OPTS='-Xmx1024m -Xms128m -Xss10m -Djansi.passthrough=true'
This works only in mac terminal, but NOT in netbeans output window:
System.setProperty("jansi.passthrough", "true");
Stumbled across this again and also about a way to remove NETBEANS-ExecEvent:
from the output:
MAVEN_OPTS=-Djansi.passthrough=true -Dorg.slf4j.simpleLogger.log.org.netbeans.modules.maven.event=off
You can set these in the project properties or as a Custom Global Maven Goal Definition to not disturb anything else (and I'm not sure if .bashrc is evaluated at all on Mac for applications that are not started from a shell; on Linux/Gnome it is, which is how I can set MAVEN_OPTS
globally, but don't, for reasons given below).
And this is the output (colorful as expected)
But, as already said, all NetBeans-added features then cease to work (collapsing of folds or discovery of run tests). I would only use this for the Build actions; definitely not for Test.
And long story short: I'm not sure how much of that can be fixed or worked around in jansi library.
On last check, the Netbeans terminal supports XTERM 16-bit colors.
When running jansi under Windows, it mistakenly assumes that the terminal does not support any colors and strips them out.
Now that Maven 3.5.0 has integrated jansi into core, it is breaking color support under Netbeans: https://netbeans.org/bugzilla/show_bug.cgi?id=270593
Please consider adding Netbeans-detection code, so colors can be used.