It is this time of the year again: We are all doing the Advent of Code (AOC), right?
For me the AOC has never been about speed and solving the problems fast and the leaderboard.
For me it has always been about learning something new or getting better at something (sharpening the saw) or developing a new, better way to solve problems (also known as becoming a better sofware craftsman).
This year my focus was on tooling: Leaning more about how to get the most out of the IDE of choice (namely VSCode) and about how to use AI as a pair programming buddy to have meaningful discussions about how to solve problems the right way (using Windsurf/Codeium) and about the new Scala3 language features and finally about Mill (one of the best, if not THE best alternative, to SBT available right now).
And I learned a LOT!!!
But sometimes the AOC is the gift that keeps on giving in very unexpected ways.
As described above my tooling-/tech-stack for this year is VSCode/Windsurf, Codeium, Scala and Mill.
Yesterday (while working on Day 21) I (finally) found a simple solution to a small problem, that has been annoying me for a while now.
As we all know, the Debug Console
is not able to process ANSI color codes. Means, if your build and/or testing tooling uses ANSI color codes to annotate the output it is going to garble up the output you see in the console and will make the output hard to read and there are (more or less convoluted) ways to configure VSCode to deal with this.
I found another (and I dare to say the most simple solution) for my/the tool-stack at hand.
First: Mill (as a lot of other build tools) does support a --color=false
flag. To make sure that this gets used when you run Mill you just put it into the .mill-opts
file at the root of the project (Note: It needs to be --color=false
. --color false
will not work).
Second: You will notice that in some cases the output is still garbled. This is because the build might use (testing) frameworks and plugins that also need to be configured to NOT use ANSI color codes. In my case my testing framework is munit. Luckily munit
support the NO_COLOR flag. Means I can disable the usage of ANSI color codes by launching VSCode with NO_COLOR=true windsurf
.
And voila … the output in the Debug Console
is readable again!
Happy coding!!!