Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Windows ANSI Color

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 COPYING First commit October 12, 2009
Octocat-spinner-32 README.textile
Octocat-spinner-32 printcol.bat First commit October 12, 2009
Octocat-spinner-32 wac.c
Octocat-spinner-32 wac.exe First commit October 12, 2009
README.textile

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:

printcol.bat

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.

Download/Installation

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.

Something went wrong with that request. Please try again.