Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANSI Colors on Windows #2461

Open
wekempf opened this issue Aug 24, 2018 · 1 comment
Open

ANSI Colors on Windows #2461

wekempf opened this issue Aug 24, 2018 · 1 comment

Comments

@wekempf
Copy link

wekempf commented Aug 24, 2018

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?

@technomancy
Copy link
Owner

Sure; feel free to submit a patch for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants