Skip to content
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

ANSI escape sequences are not stripped when stdout is redirected in cygwin. #179

Closed
tyan0 opened this issue Dec 2, 2020 · 1 comment · May be fixed by gnodet/jansi#1
Closed

ANSI escape sequences are not stripped when stdout is redirected in cygwin. #179

tyan0 opened this issue Dec 2, 2020 · 1 comment · May be fixed by gnodet/jansi#1

Comments

@tyan0
Copy link

tyan0 commented Dec 2, 2020

Overview

JANSI current git head (2.0.2-SNAPSHOT) failed to strip ANSI escape sequences when stdout is redirected in cygwin. Escape sequences in output of JANSI is expected to be enabled only when stdout is a TTY. However, current git head (2.0.2-SNAPSHOT) outputs escape sequences even when stdout is redirected to non-TTY in cygwin.

How to reproduce

  1. Install Maven.
  2. Replace JANSI with 2.0.2-SNAPSHOT.
  3. Execute mvn | less under cygwin.

Expected result

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.093 s
[INFO] Finished at: 2020-12-02T12:44:16+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
:

Actual result

[ESC[1;34mINFOESC[m] Scanning for projects...
[ESC[1;34mINFOESC[m] ESC[1m------------------------------------------------------------------------ESC[m
[ESC[1;34mINFOESC[m] ESC[1;31mBUILD FAILUREESC[m
[ESC[1;34mINFOESC[m] ESC[1m------------------------------------------------------------------------ESC[m
[ESC[1;34mINFOESC[m] Total time:  0.082 s
[ESC[1;34mINFOESC[m] Finished at: 2020-12-02T12:38:26+09:00
[ESC[1;34mINFOESC[m] ESC[1m------------------------------------------------------------------------ESC[m
[ESC[1;31mERRORESC[m] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> ESC[1m[Help 1]ESC[m
[ESC[1;31mERRORESC[m]
[ESC[1;31mERRORESC[m] To see the full stack trace of the errors, re-run Maven with the ESC[1m-eESC[m switch.
[ESC[1;31mERRORESC[m] Re-run Maven using the ESC[1m-XESC[m switch to enable full
:

The cause

I guess this is related to: fusesource/jansi-native#23

@gnodet gnodet closed this as completed in 23e71d0 Dec 2, 2020
@tyan0
Copy link
Author

tyan0 commented Dec 3, 2020

I have confirmed that the issue is solved by commit 23e71d0.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant