The cmd window looks terrible compared to rxvt/xterm ones, and unlike others, cmd is unable to interpret ANSI escape codes. The module ansiterm has been been bringing happy colors in cmd and other consoles since 2008. It wraps sys.stdout/sys.stderr in an object which intercepts the escape codes to provide the coloring by using a few functions from the windll module.


The progress bar, which was broken for a long time, is even displayed properly (waf 1.6.4):




The display in msys it also known to work in waf 1.6:


Right now, the progress bar cannot display the very last characters on Windows Vista (issue 931). The platform-specific and underdocumented functions from the module windll make it very difficult to understand and fix the problems though
windll.kernel32.FillConsoleOutputCharacterA

New python projects resembling ansiterm.py have appeared recently, here are for example:

* Colorama
* Colorconsole

Both also split the small amount of code into several files, which make the re-use only more difficult, and neither seems to support clearing single lines, which is mandatory for displaying progress bars properly.