[ 
https://issues.apache.org/jira/browse/MNG-6719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17240039#comment-17240039
 ] 

Guillaume Nodet commented on MNG-6719:
--------------------------------------

It should work in jansi 2.0 in theory:

[https://github.com/fusesource/jansi/blob/146b5f9e8d9e8cb2a8fee6d90e3fea32cb45b549/src/main/java/org/fusesource/jansi/AnsiConsole.java#L121-L133]

The code is supposed to strip jansi when redirected.  If it does not, please 
raise an issue in Jansi to fix it.

> mvn color output escape keys w/ "| tee xxx.log" on Win with git/bash
> --------------------------------------------------------------------
>
>                 Key: MNG-6719
>                 URL: https://issues.apache.org/jira/browse/MNG-6719
>             Project: Maven
>          Issue Type: Bug
>            Reporter: Gerd Aschemann
>            Priority: Major
>
> When output of {{mvn}} is redirected to a pipe (e.g., {{mvn verify | tee 
> mvn.log}}), on Windows with git (bash), the color escape characters are 
> written to the file. This works without a problem on OSX. Obviously the 
> detection if the output is a tty does not work correctly with git / bash on 
> Windows? 
> The git / bash is based on MinGW64. Probably it is not a Maven problem but a 
> combination of Maven / JDK / git?
> Used Versions:
> * git version 2.16.2.windows.1 / GNU bash, version 4.4.19(1)-release 
> (x86_64-pc-msys)
> * Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 
> 2019-04-04T21:00:29+02:00)
> * Java version: 1.8.0_191-1-redhat, vendor: Oracle Corporation
> Probably it could also be a solution to add another CLI option? I currently 
> use the {{| tee mvn.log}} approach to have both, output and log. A CLI option 
> {{-L}} (as opposed to {{-l}}) could do both, output to stdout/stderr with 
> color escape chars and output to a file without color escapes. What do you 
> think?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to