leiningen
leiningen copied to clipboard
ANSI Colors on Windows
Various plugins use ANSI escape codes to display colored text, which on Windows fails and just displays garbage characters. Some of these tools (like cljsbuild) suggest you install ansicon as a work around. However, on Win10 ANSI escape codes are actually supported. To prove this, open a PowerShell windows and enter the following:
PS> "$([char]27)[32mSuccessfully compiled [`"target/cljsbuild/public/js/app.js`"] in 28.163 seconds.$([char]27)[0m"
That's actually the output string from cljsbuild and it properly will display with green text.
So, why doesn't "lein cljsbuild once min" produce that message in green text, instead outputting the escape characters? Because, right now unfortunately, this is an opt-in feature that requires the program to call SetConsoleMode
with ENABLE_VIRTUAL_TERMINAL_PROCESSING
. So, if lein were to call that there'd be no need for ansicon. Any chance this could happen?
Sure; feel free to submit a patch for that.