Weird control characters from Gradle in Windows 10 Weird control characters from Gradle in Windows 10 windows windows

Weird control characters from Gradle in Windows 10


I've seen this happen in the Git BASH shell that's part of Git For Windows. For me, the solution was to set TERM to cygwin. This fixed the output without introducing any issues handling backspace.

export TERM=cygwin

I also tried xterm, xterm-256color, ansi, and vt100. The cygwin term has been the most reliable for me. I'm now running \usr\bin\bash.exe in Windows Terminal, and so far it has worked well.


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


To fix this on Windows 10 create a new DWORD key HKEY_CURRENT_USER\Console\VirtualTerminalLevel set to 1. See this for more info.