wac – Windows ANSI Color
wac.exe is a small command line utility that lets you use ANSI colors on Windows. This will print nice colors:
printcol.bat | wac
This will not:
Some command line tools (like Cucumber) like to print ANSI colors.
Since Windows has no idea what ANSI colors are, all you’ll see is gibberish. Unless
you use wac.
But we have Win32::Console
I know that Perl, Ruby, Python etc have native libraries that will do ANSI coloring on Windows,
but not all platforms have that. If you’re using e.g. JRuby on Windows there is no such
library. So wac will save you.
Just download wac.exe and put it somewhere on your PATH.
How does it work?
wac.exe reads from STDIN and prints to STDOUT. While doing that it looks for ANSI color codes, and if it finds one,
it sets the console color accordingly and strips away the color code from the output.
How do I build it?
Just get MinGW and run:
gcc -o wac wac.c
Why is it in C?
Because it’s easy to change colors on Windows with C.
Why is the C code so bad?
Because I never do C. Feel free to improve that.
I have found a bug
Great. Just fork this Git repo, clone your fork and fix it.
When you have pushed your changes back to your repo, send me a pull request.
I have found a bug, but I don’t know C.
I don’t know C either. Find someone who does.