Sbt 1.5.0 vs sbt 1.4.4 terminal behavior

I am using scala 3.0.0 RC3 and running compilations under emacs. I am forced to use sbt 1.5.0 (1.4.4 does not compile the code successfully, while 1.5.0 does). However sbt 1.5.0 prints out a lot of terminal escape codes under emacs, which sbt 1.4.4 does not print. For example using the repo obtained from:

sbt new scala/scala3.g8

The compilation with 1.4.4 (this can be set in project/build_properties) looks like this under emacs:

sbt compile
[info] welcome to sbt 1.4.4 (Private Build Java 1.8.0_282)
[info] loading project definition from /home/laing/my/repos/repro2/project
[info] loading settings for project root from build.sbt ...
[info] set current project to scala3-simple (in build file:/home/laing/my/repos/repro2/)
[info] Executing in batch mode. For better performance use sbt's shell
[warn] 

while the same code compiled with sbt 1.5.0 under emacs produces the following:

sbt compile
e[0m[e[0me[0minfoe[0m] e[0me[0mwelcome to sbt 1.5.0 (Private Build Java 1.8.0_282)e[0m
e[0m[e[0me[0minfoe[0m] e[0me[0mloading project definition from /home/laing/my/repos/repro2/projecte[0m
e[0m[e[0me[0minfoe[0m] e[0me[0mloading settings for project root from build.sbt ...e[0m
e[0m[e[0me[0minfoe[0m] e[0me[0mset current project to scala3-simple (in build file:/home/laing/my/repos/repro2/)e[0m
e[0m[e[0me[0minfoe[0m] e[0me[0mExecuting in batch mode. For better performance use sbt's shelle[0m

How can this be corrected? Thank you.

ps. I am running the compilation in an emacs window but many versions of sbt up to 1.4.4 had no problem with this. I’ve been able to fix similar problems in the past by saying

sbt -Djline.terminal=jline.UnsupportedTerminal compile

but that does not work now.

Try sbt --no-colors ?

Also, try to use sbt version ~1.4.5

Does that help? Which launcher are you using? (sbt --script-version)

I would suspect that 1.4.9 is the version that might have broken things here, since that’s were jline was updated…

Using sbt --no-colors solves the problem. Just for information, my launcher was 1.4.9. The actual compilation is successfully done by sbt 1.5.0 now with no terminal escape codes under emacs. Thank you so much @cbley for your help!!