fusesource / jansi

Jansi is a small java library that allows you to use ANSI escape sequences to format your console output which works even on windows.
http://fusesource.github.io/jansi/
Apache License 2.0
1.11k stars 140 forks source link

Not working on windows #161

Closed FrenchTechLead closed 3 years ago

FrenchTechLead commented 4 years ago

The following code :

AnsiConsole.systemInstall();
System.out.println( ansi().eraseScreen().fg(GREEN).a("✓ Compilation Completed Successfully").reset() );
AnsiConsole.systemUninstall();

Renders :

←[32m? Compilation Completed Successfully←[0m

On windows 7 x64.

frossm commented 4 years ago

With my build of Windows 10 x64 (18362) I was able to get get JANSI to work with the native cmd.exe ANSI processor. I had to create the following key in the registry and assign it a DWORD value of 1

HKCU\Console\VirtualTerminalLevel

I restarted cmd.exe and the colors now appear correctly. I'm sure this won't work for Windows 7 as it enables the windows 10 ANSI capabilities, but thought I would include it here should you upgrade or if others need it.

Michael

gnodet commented 3 years ago

Looks like a duplicate of #125