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

Terminal color codes do not work on Windows #899

Open
aramperes opened this issue Apr 16, 2018 · 4 comments
Open

Terminal color codes do not work on Windows #899

aramperes opened this issue Apr 16, 2018 · 4 comments

Comments

@aramperes
Copy link
Member

aramperes commented Apr 16, 2018

Color codes inside the console have stopped working for a while on my machine. I very well remember this
working correctly before, and it does work with other server platforms (e.g. Spigot).

Tested with commit be008ff. Perhaps this has been broken since a commit that upgraded the logging library, such as #859.

I am using Windows 10.

This is what I see in in CMD:
image

Similarly, in PowerShell:

image


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@mastercoms
Copy link
Member

This may have been fixed in 5b8b939 with jansi being upgraded to 1.17.1.

@aramperes
Copy link
Member Author

Still having the same issue on latest (cd89b6b)

@mastercoms
Copy link
Member

mastercoms commented Apr 27, 2018

Alright, we may have to wait until a new jansi comes out (as I see some progress on similar issues related to colors in the latest dev release), or for Glowstone to be upgraded to jline3 (though I believe jline3 just doesn't support colors on Windows last I checked).

@aramperes
Copy link
Member Author

aramperes commented Apr 27, 2018

I found two workarounds for this issue on Windows:

1. Windows 10 has a registry key to enable ANSI escaping by default. A step-by-step guide can be found here.

In summary, setting the registry DWORD HKEY_CURRENT_USER\Console\VirtualTerminalLevel to 1 will enable ANSI escaping by default for CMD. In PowerShell, it appears to simply ignore escaping (just shows plain color). Note: the regkey may not exist by default, so you will have to create it yourself.

2. Use an alternative console emulator that supports ANSI escaping. My personal favorite is cmder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants