ANSI Command Line Colors under Windows

Having colored text in the command line is a great help for spotting error or success messages. Unfortunately, those of us developing under Windows do not have this feature by default. Here’s how to enable it:

  1. Download ANSICON from http://adoxa.110mb.com/ansicon/index.html or https://github.com/adoxa/ansicon
  2. Extract the proper files (Depending on if you have a 32 or 64 bit machine) to c:\ansicon\ (For example). I have a 32 bit machine and hence I extracted the files from inside the x86 folder.
  3. Open a command line prompt and go to c:\ansicon, and then type “ansicon -i” without the quotes
  4. Done

You can now enjoy the colored output of PHPUnit for example.

ANSI Command Line Colors Example with PHPUnit

Note: I have installed ANSICON 1.3 under Windows 7. My best guess is that this process will work for other versions of Windows too.

Update: I have written a new post on how to Generate Command Line Colors with PHP

Searching...
Powered by Google