【问题标题】:ConsoleZ maven color outputConsoleZ maven 颜色输出
【发布时间】:2018-02-13 09:41:03
【问题描述】:

最近的 maven 版本在终端中进行彩色输出。 Git Bash 显示正确的颜色,但配置为使用 git bash 的 ConsoleZ 没有。它只输出原始颜色代码。有人知道怎么解决吗

$ mvn clean
[←[1;34mINFO←[m] Scanning for projects...
[←[1;34mINFO←[m]

【问题讨论】:

    标签: windows maven console


    【解决方案1】:

    在 Cygwin 上,当我将 Maven 的输出通过管道传输到 tee 命令时,它会修复输出,以便显示实际的彩色文本而不是 [←[1;34mINFO←[m] 内容:

    ./mvnw -pl *-common -pl *jdbc-autoconfig dependency:tree -Dincludes=org.springframework | tee

    【讨论】:

      【解决方案2】:

      我在 Window10 中使用 Git Bash 在 Console2 和 ConsoleZ 中遇到了同样的问题(尝试不同的配置,但它不起作用)。 经过多次尝试,我决定尝试ConEmu。 太棒了,它完美无缺。我可以像在 ConsoleX 中一样配置我喜欢的所有行为,并且底线是 ma​​ven 现在可以像在本机 git bash 中一样正确显示

      我想你可以试试 ConEmu。 这是GitBash的配置(和ConsoleX完全一样)

      设置 -> 启动 -> 添加新 (+)

      任务参数

      /icon "C:\Program Files\Git\mingw64\share\git\git-for-windows.ico" /dir E:\

      命令

      "C:\Program Files\Git\bin\sh.exe" --login -i

      记得更新你的路径

      希望这会有所帮助。

      【讨论】:

      • 谢谢!我迁移到 ConEmu
      【解决方案3】:

      跟进Lyle Z's 的回答我现在使用以下别名:

      alias mvn="mvn_tee_output"
      function mvn_tee_output () {
          "mvn" $@ | tee
      } 
      

      【讨论】:

        猜你喜欢
        • 2017-09-24
        • 1970-01-01
        • 2014-04-19
        • 2023-03-11
        • 1970-01-01
        • 2021-11-16
        • 2012-06-17
        • 2013-12-18
        • 1970-01-01
        相关资源
        最近更新 更多