ANSI colours in Windows console

I develop a number of PHP console applications and it was annoying me that ANSI colour (or color) and other escape codes don’t work in the Windows console. I like to use colours in console output for automated test scripts and other things as it’s really helpful.

Luckily, Jason Hood has written an application that enables ANSI escaping in the Windows console. It can be found at his site. Just download it, extract the x64 or x86 directory as you require and run ansicon -i. You will now have a new environment variable called ‘ANSICON’ and ANSI escapes will work!

  • Twitter
  • Facebook
  • LinkedIn
  • RSS
  • Add to favorites
  • Digg
  • Reddit
  • Slashdot
Apr 16 2011
Categories: Development, PHP

Comments

Great post! I’ve just downloaded from the site you linked.

Danny : 22:52 : Jun 19 2011

Leave a Reply