You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have to question whether these lines are even necessary anymore on anything other than Windows. And Windows 10 I believe has native ANSI support.
In fact, I had recently tried the logback feature that enabled ANSIConsole <withJansi>true</withJansi> and it just seemed to break the output under Cygwin rather than help.
Do you happen to know if it's safe to just leave these lines out entirely? Should we still be using them, but make it conditional on some Windows version? In most cases, I think we would try to place the uninstall in a finally block to make sure it is called (as I think an improper uninstall may mess up the I/O streams for future calls).
The text was updated successfully, but these errors were encountered:
Good catch!
I went ahead and fixed the example and the README (in a finally block).
Windows 10 does have native ANSI support, but "it's complicated" and it is switched off unless the application does something special. java does not do this "something special", so we don't get to enjoy this...
So, practically speaking, on Windows, using Jansi to get colors is the most reliable method.
I am not aware of any issues with the Cygwin/Jansi combination. If you have links or more info I can take a look.
Making this conditional for Windows-only is not a bad idea. In fact, that is what picocli-jansi-graalvm does, see this example.
I am not sure if JLine3 can be used to create GraalVM native images (although I think the Micronaut native CLI may be using JLine, not sure which version), so I had not thought to point to picocli-jansi-graalvm instead of plain Jansi.
picocli/picocli-shell-jline3/src/test/java/picocli/shell/jline3/example/Example.java
Line 152 in 466975a
systemInstall()
, but notsystemUninstall()
.However, from
picocli/src/test/java/picocli/HelpAnsiTest.java
Line 118 in 34a7d3a
In fact, I had recently tried the logback feature that enabled ANSIConsole
<withJansi>true</withJansi>
and it just seemed to break the output under Cygwin rather than help.Do you happen to know if it's safe to just leave these lines out entirely? Should we still be using them, but make it conditional on some Windows version? In most cases, I think we would try to place the uninstall in a
finally
block to make sure it is called (as I think an improper uninstall may mess up the I/O streams for future calls).The text was updated successfully, but these errors were encountered: