Closed tyan0 closed 3 years ago
Msys2 already migrated to cygwin 3.1.x. @tyan0 do you know any walk around to force apps that use jansi to solve color escapes? Because it might be some time until fix is merged, and picked by other apps/libs.
Edit, this might be gradle problem after all, because they have their own ansi utils which is based on old jansi code.
In my environment, running cygwin 3.1.4, the TERM variable is set to xterm-256color. This breaks the output from maven 3.6.3. Setting TERM to cygwin resolves the problem e.g.
> TERM=cygwin mvn
Another more general workaround is to set the system property jansi.passthrough=true
.
I think this has been fixed in 2.x, please reopen if needed.
I have confirmed that Maven works as expected in cygwin 3.1.7 with/without pseudo console enabled if jansi is replaced with 2.0.2-SNAPSHOT.
Thanks!
Overview
In cygwin 3.1.0 or newer, output of jansi is distorted in Win10 1809 or later.
Description
Output of Maven, which uses jansi 1.17.1, is distorted in new cygwin (3.1.0 or newer). For example in mintty:
Lines with '-------' are wrapped before right edge of the screen and stray spaces are inserted in the word been.
Another example in console:
In this case, the escape sequences are garbled. This causes in Win10 1703 or later.
The Cause
New cygwin adds pseudo console support to PTY. New PTY provides pure windows console for native (non-cygwin) apps. As a result, native apps can not use ANSI escape sequence in PTY even in mintty unless setting ENABLE_VIRTUAL_TERMINAL_PROCESSING. Furthermore, cygwin console (cygwin in command prompt) uses xterm compatible mode, which is enabled by ENABLE_VIRTUAL_TERMINAL_PROCESSING, and set TERM to xterm-256color rather than cygwin.
These changes cause incorrect judgement of terminal type in JANSI. Currently, JANSI works as expected in MSYS2, however, MSYS2 is based on cygwin, so probably the same problem will occur in near future.
Patch for this issue