Add a --color flag to the CLI and disable colors for Pkl test
The --colors flag makes it possible to forcefully disable colour output, and also forcefully enable it. We make use of this in the native Pkl test engines by passing --colors=never into the pkl commands, which ensures we get a predictable output.
Additionally the pkl test command also sets --colors=never to ensure that pkl test output isn't accidentially contaminated with ansi escape chars, which will break example based tests.
This may be more complicated than what it's worth, but really, pkl test should color the "outside" exceptions and not the "inside" ones, i.e. if pkl test itself throws, it should be colored, but anything inside a module.catch(...) should not.
I don't think this is something that should hold you back, especially considering we want to try and avoid the Jansi dependency in pkl-core. @bioball's suggestion of passing in a formatter does seem the most sensible way to go.
@holzensp yeah my plan to stop working on this approach, and look at passing in a formatter. As I mentioned here, the number of hacks and whatnot that are piling up to make this approach work doesn't feel good. I wouldn't be comfortable merging such a fragile pile of hacks and workarounds.
Closing this; superseded by #746