-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Windows Command Line and Powershell display ANSI escape codes instead of expected formatting #62
Comments
Hi again, sorry that I didn't performed an exhaustive search in the closed issues. I can confirm that #54 (comment)
I have to declare that I just installed Windows Terminal out of curiosity and following your conversation at PowerShell/PowerShell#11449 Still, I suggest to document both options and provide a code snippet in the README.md so people can enable in the program itself. Some times you do not have permissions to change the registry (for example at School / University labs). |
Hola Ivan, and thank you for bringing this to my attention (and all the debugging you did!) Which version of Powershell did you use, when JColor didn't work? |
Olá Diogo, I tried the one that is by default installed in my laptop (windows 10 circa 2018) and seems to be Powershell 5.1.19041.1320. I get that version number when I run it directly (powershell.exe) o through Windows Terminal. |
This SO answer summarises the problem/solution regarding ANSI escapes codes on Windows Command Line / Powershell. I (mis)understood that Powershell +6 had support for ANSI codes by default. Clearly that is not the case, as you just showed. Workarounds (sorted by descending order of convenience)
Next stepsI will add a note about this problem and workarounds in the docs. |
Hi, regarding the SO comment, I tried to follow the regedit approach without success (tried both closing the session and rebooting), at least trying to run the example application through Windows CMD or powershell (in both cases without using Windows Terminal). Did you have success following the instructions ? Regarding the approach I would, at least, document both solutions, maybe not including the source code in the distribution itself, but at least in a sample project like JColor-Sandbox and referenced it from the README.md. My reasoning about documenting |
I added a new section to the README to make this limitation explicit. Do you think it has enough info? If so, I will close the issue. |
Hi @dialex I think that it has enough info. If you finally remove the JNA dependencies from the pom.xml, would be nice to make that clear that also in the comment / README.md. |
Cool! I will do that, but that will have to wait for a month, because I need to make a maven release from a machine with my credentials. But I will do that 😉 Thank you one more time for finding this bug! Ten un buen fin de semana |
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
Expected behavior
Show colored output of the application.
Screenshots
N / A
Environment
The text was updated successfully, but these errors were encountered: