Closed AlexisJehan closed 3 years ago
I've just tried both cmd and PowerShell on Windows 10 and it works for me. Do you have the latest windows 10 ?
Could you run java -jar jansi-2.1.0.jar
and paste the output please in both cmd and PowerShell ?
I confirm it works using java -jar jansi-2.1.0.jar
.
This code was working until 2.0.1:
public static void main(final String[] args) {
final PrintStream output = AnsiConsole.out();
output.println(Ansi.ansi().fgBrightRed().a("Hello world").reset());
}
I've had another look, and this is working with 2.1.0, adding a single line:
public static void main(final String[] args) {
AnsiConsole.systemInstall();
final PrintStream output = AnsiConsole.out();
output.println(Ansi.ansi().fgBrightRed().a("Hello world").reset());
}
So since 2.1.0, AnsiConsole.systemInstall();
appears to be required before using AnsiConsole.out();
to get colors in both PowerShell and cmd. That was not the case in previous versions.
Ah, yes, that's right.
If you want to restore the previous behavior, you can set the jansi.eager
system property to true
.
Was working until 2.0.1:
Does not work anymore since 2.1.0:
Thanks in advance having a look.