-
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.16 / Maven 3.5.1 regression] ANSI escape codes for colors are not interpreted correctly in Cygwin and MINGW (GitBash and Intellij IDEA terminals) #94
Comments
Environment details (Git-for-windows/GitBash):
|
Environment details (Cygwin):
|
Quoting @hboutemy (from JIRA comment)
Maybe this would be a good starting point, I'll try to dig deeper: |
here are my latest findings: |
Thanx @hboutemy. Results for different terminals:
Snapshots (IDEA vs. GitBash vs Eclipse) |
@hboutemy I digged this for your
|
|
isatty test (https://github.com/hboutemy/jansi/pull/2) shows this: IntelliJ IDEA MINGW64: (stdout IS a TTY, 'isatty' has a value of 64):
Cygwin and GitBash MINGW64 (via TM terminal plugin) (no colors): (stdout is NOT a TTY, 'isatty' has a value of 0):
Eclipse MINGW64 (viaTM terminal plugin) is a clear winner: |
As stated by @hboutemy
This is likely to be the case (at least for a current jansi HEAD). Not sure about IntelliJ IDEA although. |
I updated Jansi test program to be explicit on the choice done by Jansi: PASSTHROUGH, STRIP_ANSI, WINDOWS or RESET_ANSI_AT_CLOSE. With this update, it clearly shows that on GitBash, Jansi does STRIP_ANSI |
I have an easy half fix: just don't strip ANSI escape code when stdout is not a terminal if on MINGW or CYGWIN
This is not perfect, since someone on Cygwin redirecting output to a file will get ANSI escape codes (should be stripped), but this is IMHO a minimal price to pay
as you can see, stdout is not seen as terminal (given the real workaround for MINGW pseudo terminal detection has not been implemented) but Jansi now decides to not strip ANSI codes This can be used as a quick workaround if implementing full algorithm is too hard (I'm not able to do it myself, for example, since it will require a jansi-native update) |
just tested:
|
fixed by using jansi-native 1.8 in 3f47f7e |
Prologue: Maven jira ticket -->> MNG-6282
Details / history:
Jansi revert / downgrade (to, say, version 1.15) solves colors issues in maven 3.5.1, but, according to @hboutemy, this action is a no-go a due to related changes / tickets (see this JIRA comment)
Git-bisect shows this commit (that introduced regression): bb3d538 ANSI output stripping does not work if TERM is xterm, fixes #83
Maven 3.5.0 and 3.5.1 outputs in GitBash and Cygwin terminals:
Note: @hboutemy branch / PR #88 was used in order to confirm issues on both terminals (see comments below).
The text was updated successfully, but these errors were encountered: