-
Notifications
You must be signed in to change notification settings - Fork 182
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
use jansi's windows support #44
base: master
Are you sure you want to change the base?
Conversation
Change jansi shading to include JNI package for Windows support and enable it in AnsiWindowsTerminal so Windows users can have working ansi support without installing extra programs.
+1 |
@@ -64,6 +64,8 @@ private static OutputStream wrapOutputStream(final OutputStream stream) { | |||
} | |||
|
|||
private static boolean detectAnsiSupport() { | |||
AnsiConsole.systemInstall(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is valid, detection of ANI support should not install ANSI support, which is what this change does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, this should be part of the software using jline imho.
I don't think we should do that. AnsiConsole.systemInstall() messes with the system streams and should be in control of the caller, not a side effect of detecting if it will work. The main reason is that some software want to do more with system streams, such as redirecting or having a thread based streams like Karaf. |
I don't really get this pull at all... windows should work w/o these changes presently, is this not the case? |
Without these changes you have to use ansicon to get ansi support on windows. Otherwise it just spits the ansi codes out in to the terminal which looks like garbage to people who don't understand it. |
Don't you embed jline in your application ? You can easily call AnsiConsole.systemInstall() in your application before starting the console. |
What is the status of this change can i use this change in my code? |
@jonatzin: not sure to understand your question. AFAIU calling AnsiConsole.systemInstall() before creating the console allows you to cleanly support Ansi on windows. |
@gnodet Sorry I'll rephrase. Currently the issue mentioned above is a problem in my code (which embeds jline 2.6), can I apply the above code changes? Should I just use AnsiConsole.systemInstall(); in my code? Should I change the pom.xml? |
I'd go for calling AnsiConsole.systemInstall() before creating the console ... and I don't think the pom needs any change afaik. |
OK, so just to make sure I shouldn't change the source of jline? |
Also when should I call AnsiConsole.systemInstall()? Wouldn't calling it on a linux machine cause a problem? |
Well, I guess you should try it, but I'm calling it myself without any problems ;-) |
Hello everyone, So I regret to say that simply calling AnsiConsole.systemInstall() doesn't solve the issue. My code works fine on unix machines, Win7 however it doesn't work on Win2008R2SP1. Any suggestions? |
Yeah, it seems there's an issue on Win 2008, but I don't think it's related to jline. But I don't think there's anything to do in jline, or maybe a graceful degraded mode, but we can't really install the system DLLs. |
See http://forums.bukkit.org/threads/cb-2190-startup-error-java-lang-noclassdeffounderror.76218/ for a related discussion ... |
Change jansi shading to include JNI package for Windows support and enable
it in AnsiWindowsTerminal so Windows users can have working ansi support
without installing extra programs.