Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netbeans support #87

Open
cowwoc opened this issue May 9, 2017 · 11 comments
Open

Netbeans support #87

cowwoc opened this issue May 9, 2017 · 11 comments

Comments

@cowwoc
Copy link

cowwoc commented May 9, 2017

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.

@cowwoc
Copy link
Author

cowwoc commented May 9, 2017

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.

@gnodet
Copy link
Member

gnodet commented Sep 20, 2017

Sure. Any idea how to detect Netbeans ?

@cowwoc
Copy link
Author

cowwoc commented Sep 20, 2017

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?

@gnodet
Copy link
Member

gnodet commented Sep 21, 2017

It already exists: -Djansi.passthrough=true should let ansi sequences through.

@cowwoc
Copy link
Author

cowwoc commented Sep 22, 2017

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?

@peterremote1980
Copy link

-Djansi.passthrough=true is not working in Netbeans 8.2 with maven 3.5.3, just tried

@hboutemy
Copy link
Collaborator

hboutemy commented May 28, 2018

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?

@rkraneis
Copy link

@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 ...

@peterremote1980
Copy link

@rkraneis i added this to .bashrc, but not working :-) Thanks anyway

export MAVEN_OPTS='-Xmx1024m -Xms128m -Xss10m -Djansi.passthrough=true'

@peterremote1980
Copy link

This works only in mac terminal, but NOT in netbeans output window:

System.setProperty("jansi.passthrough", "true");

@rkraneis
Copy link

rkraneis commented Jan 28, 2021

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).

image

And this is the output (colorful as expected)

image

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.

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

No branches or pull requests

5 participants