Windows ANSI Color

License: WTFPL

Language: C

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:


Why wac?

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.

Project Statistics

Sourcerank 5
Repository Size 99.6 KB
Stars 42
Forks 11
Watchers 7
Open issues 3
Dependencies 0
Contributors 1
Tags 0
Last updated
Last pushed

Top Contributors See all

Aslak Hellesøy

Interesting Forks See all

Windows ANSI Color
C - Other - Last pushed - 2 stars

Something wrong with this page? Make a suggestion

Last synced: 2017-11-24 20:01:58 UTC

Login to resync this repository