-
Notifications
You must be signed in to change notification settings - Fork 34
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
Problems with MinGW Terminal #38
Comments
So if I use Windows Terminal to create a console with My installation may be different than yours, but if not, maybe the problem is in the way you're building or running with your Outputs like Given that your prompt is colored in the screenshot, the terminal clearly does support VT processing. Something must be getting escaped or a configuration changed in the way your jvm code is running. Sorry I can't be of more help, but maybe you can search for ANSI code issues on MinGW with Java. If you find a solution that doesn't require JNI, I'd love to integrate it. |
Some searching lead me to the following issues:
and the following library: https://github.com/alexarchambault/windows-ansi Adding I'm not sure if this is the only solution, I'm even unsure if it is the right solution. It may even be possibly solved in newer Java versions, but it seems to solve the problem. It looks though, that it requires low level JNI "magic", which you possibly do not want to make use of :-/ As I'm interested to build native versions (some day), because startup time is not as good as it should be for a console application, things did become more complicated this way :-/ $ java -version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7)
OpenJDK 64-Bit Server VM Temurin-11.0.12+7 (build 11.0.12+7, mixed mode)``` |
Thanks for the research! So to summarize, it looks like the problem is a combination of Windows Terminal allowing apps to disable VT processing, and the process (possibly Java?) disabling it. It seems like |
I believe the issue discussion is mixing up some things: MinGW terminal is not running in the Windows Terminal application usually, but inside mintty (aka Git Bash). Anyway, I'm also facing the issue that color does not work when running ORT on Windows, no matter what the terminal is. I've tried the following an none output color:
However, all of these combination theoretically support color, as I see it working when setting the Is the only solution to the problem still calling |
@sschuberth I think your problem is unrelated to this issue. If |
I'm running through the script generated by the Gradle application plugin's I'll amend my post above with conhost as a termnial plus cmd.exe, that also does not work. And if I use |
I guess I'd need more information to help; Windows Terminal works fine for me, including detection. |
Hm, that works without issue on my side on both cygwin and cmd.exe shells, on both Windwos 10 and 11. What are the values of |
Odd. I'm now using #126 to get the numbers:
Environment variables (I've XXXed some values):
|
Thanks for the info. So based on your environment it looks like Mordant is behaving correctly. The only way to tell what terminal you're running on is by looking at environment variables like |
Oh. I wonder how other tools like Gradle then seemingly properly detect color capabilities of the terminal. I should also check tool like picocli to see how they work in this regard. Edit: I wonder whether instead a method as described here could be used. |
Ok, so for mintty as a terminal I was able to solve the problem via #127. Regarding the new Windows Terminal application, the problem in my case is that it's set as the default terminal in Windows 11, in which case there's a bug that |
Hello :-) I'm the author of https://github.com/Framstag/taskdown
I use mordant (the latest beta) to add colored output in the terminal and (with the new beta) to print nicely formatted Markdown to the terminal.
This works perfectly under Linux and under Windows native, however it does not work under MinGW (under Windows). The problem occurs with the standard installation, but also with the integration inf MinGW in the new Windows terminal (calling bash.exe -l -i from the terminal configuration).
The problem is, that I use MinGW under Windows as preferred working environment.
I'm not sure what exactly the problem is, or if it is even a problem of mordant itself. IF I call my program with TERM=dumb (the problem disappears (unsurprisingly)). I tried to set TERM to other values to trick the autodetection mechanism, but did not find a variant to resulted in working output.
DOS Shell:
MinGW bash:
I obviously need some help, and I'm willing to help you if you give me advice what to do.
The text was updated successfully, but these errors were encountered: