Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6719

mvn color output escape keys w/ "| tee xxx.log" on Win with git/bash

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.8.2, 4.0.0-alpha-2, 4.0.0
    • None
    • None

    Description

      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?

      Attachments

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              ascheman Gerd Aschemann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: