-
Notifications
You must be signed in to change notification settings - Fork 140
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
Jansi 1.12+ stopped working with 'cmd.exe' if executed inside Eclipse's Local Terminal #64
Comments
I think I found the cause of the problem, which is actually the upgrade we did in the first place: It's these two pull requests by @sschuberth In the Eclipse terminal above, the term variable is set to xterm:
If I do
Jansi works again. This is because the Cygwin check is checking for xterm: Can the check maybe be improved? Or is it something the TM terminal should not do? @sschuberth what is your take on this? |
To me this indeed is something TM terminal should not do. By setting |
I agree and I reported this to the TM terminal team: What do you think about making the check more robust anyway by checking if cmd.exe is running in addition to checking for TERM=xterm? |
Eclipse TM Terminal uses https://github.com/rprichard/winpty for running Windows programs inside its xterm emulation. So for us, setting TERM=xterm is correct (since that's what we natively interpret) but winpty changes that to Windows Console API. I think that just checking the TERM environment variable in jansi is not sufficient to determine, whether Windows Console API or ANSI Sequences should be sent. It should really check whether it's running inside a Windows Console host or not (I don't know how to check that). I suspect that as of today, your test would also fail if you open a Cygwin mintty and inside that mintty execute "winpty java -cp jansi-1.13.jar org.fusesource.jansi.Main" as per https://github.com/rprichard/winpty#using-the-unix-adapter ... Or, if you have cygwin sshd running, log into that sshd from a remote Linux box (with real xterm) and then run "winpty java -cp jansi-1.13.jar org.fusesource.jansi.Main" . I have reached out to @rprichard to get his opinion on this. |
Really? So winpty breaks ANSI support by the underlying terminal?
I fear that even adding such a check would not cover all cases. Implementing the check by looking for
I don't have Cygwin installed, but I do have Git for Windows 2.10 installed, which builds upon MSYS2 and comes with both
and also
|
I just double-checked on another Windows machine:
only returns colored output on my Windows 10 machine, on Windows 8.1 I see literal escape sequences. So the interpretation of the ANSI codes came from Windows 10 in my case ... |
I commented on the Eclipse bug report (https://bugs.eclipse.org/bugs/show_bug.cgi?id=502134). I think Eclipse's TM Terminal should stop setting winpty works by creating a hidden console buffer and scraping its content using To get color working with winpty, the console program needs to colorize its output exactly the same way it would with an ordinary Windows console. Prior to Windows 10, it could use |
Closing as inactive and targeted to the unsupported 1.x. |
We use Jansi in Gradle and got a bug report after updating the Jansi dependency to 1.13.
After some investigation I found that from 1.12+ Jansi stopped working on cmd.exe when executed inside Eclipse's terminal (TM Terminal). See attached screenshot.
Reproduce:
On Windows: Install Eclipse > Install 'TM Terminal' (from Neon Update Site) > Open View 'Terminal' > new 'Local Terminal'
See also:
https://issues.gradle.org/browse/GRADLE-3562
https://discuss.gradle.org/t/console-output-is-not-readble/19625
The text was updated successfully, but these errors were encountered: