Windows 10 中来自 Gradle 的奇怪控制字符 [英] Weird control characters from Gradle in Windows 10

查看:14
本文介绍了Windows 10 中来自 Gradle 的奇怪控制字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在控制台中,自从切换到 Windows 10 后,当从 CMD 运行时,我从 Gradle 获得了时髦"的输出.

In the console I get "funky" output from Gradle when run from CMD since switching to Windows 10.

[0K
[0K
[2A[1m<==-----------> 18% EXECUTING [9s][m[34D[1B[1m> :compileScala[m[15D[1B[2A[1m<==-----------> 18% EXECUTING [10s][m[35D[2B[2A[1m<==-----------> 18% EXECUTING [11s][m[35D[2B[2A[1m<==-----------> 18% EXECUTING [12s][m[35D[2B[2A[1m<==-----------> 18% EXECUTING [13s][m[35D[2B[2A[1m<==-----------> 18% EXECUTING [14s][m[35D[2B[2Athere were four feature warnings; re-run with -feature for details
four warnings found

我想这是某种控制字符消失的情况,其中 Gradle 试图合理地为其输出着色,而 Windows 正在解释错误.PowerShell 和 SBT 工作正常 - 但将控制台属性"设置从 PowerShell 复制到 CMD 并不能解决问题.

I imagine this is some sort of control-characters-gone-wild where Gradle is trying to sensibly colour its output and Windows is interpreting that wrong. PowerShell and SBT works fine - but copying the console "Properties" settings from PowerShell to CMD doesn't fixit.

有人解决了吗?

UPDATE 2018-01-28 它也发生在我在 OSX/macOS/whatnot 之上的 Jenkins/Alpine/Docker 设置中.不再只是窗户了.

UPDATE 2018-01-28 It's also happening in my Jenkins/Alpine/Docker setup atop OSX/macOS/whatnot. Not just windows anymore.

...但是...它不会发生在 Surface 笔记本电脑工作给我...超级奇怪.Whatevs gradlew --console=plain 对我来说很好用.

... but ... it doesn't happen in the Surface laptop work gave me ... super weird. Whatevs gradlew --console=plain works fine for me.

推荐答案

我猜你可以在 gradle 命令行中传递 --console plain 来禁用富控制台,这可能是原因时髦"的角色

I'm guessing you could pass --console plain in the gradle command line to disable the rich console which is likely the cause of the "funky" characters

https://docs.gradle.org/current/userguide/gradle_command_line.html

这篇关于Windows 10 中来自 Gradle 的奇怪控制字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆