windowsgradlecmdwindows-10windows-console

Weird control characters from Gradle in Windows 10


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

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.

Has anyone resolved this?

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

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


Solution

  • 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