Skip to content

Windows Command Line and Powershell display ANSI escape codes instead of expected formatting #62

@imartinezortiz

Description

@imartinezortiz

Describe the bug

Hi, I've setup a simple maven project with your library to test the example code included in the README.md of the project, but unfortunately running the application does not show the text with colors and other attributes but the plain escape sequences. Trying to figure it out the problem, I also tested https://github.com/dialex/JColor-Sandbox with the same result.

Seems that during the migration process from JCDP to JColor you removed too much code, in particular the code included in baa3b95 that actually uses JNA to enable the ENABLE_VIRTUAL_TERMINAL_PROCESSING flag.

Adding the enableWindows10AnsiSupport() method from the commit and the OS versions checks from that commit into the JColor-Sanbox project make it to work ok again.

Also, the pom.xml has a JNA as a compile time dependency but I can't find where it is used. Besides, xstream dependency is neither used, did I miss something ?

I suggest to at least add a section to the README.md with the boilerplate code required to activate the feature.

PS: congrats for your project

To Reproduce

  1. In a Win 10 clean machine setup create / compile https://github.com/dialex/JColor-Sandbox.
  2. Run the generated jar file in a Windows CMD terminal

Expected behavior
Show colored output of the application.

Screenshots
N / A

Environment

  • OS: Windows 10 21H1 (19043.1348)
  • Version 5.0.0, 5.0.2

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions