From: Michal Suchanek Date: 2009-08-07T06:53:27+09:00 Subject: Re: Change console forground to Red or Green 2009/8/6 Thomas Chust : > 2009/8/6 Laup-Dawg : >> [...] >> This is what I saw in the window's command window after running the >> script. >> >> "The test ←[31mFailed←[0m" >> >> The foreground color didn't change to red, it remained the default. >> [...] > > Hello, > > as Gordon Thiesfeld already mentioned in this thread, the Windows > console doesn't support ANSI escape sequences natively and that the > win32console gem could be useful to emulate such functionality. The > output you see includes the uninterpreted escape sequences verbatim -- > so it actually looks "right" in a certain sense ;-) > > I faintly remember that in the DOS and Windows 95 days you also had > the option to load a driver that globally taught the console to > display ANSI escapes, but I have no idea whether something similar is > still available for modern Windows systems. I haven't touched a > Windows box in ages, so I don't have any hands-on experience in this > area. My hands-on experience suggests that this driver still exists but is useless. It somehow interprets the output of echo commands (and not ruby scripts) and works in command.com (and not in cmd.exe). That's why I suggest using a different windows-native method rather than escape sequences. Of course, you can also install mingw with its terminal emulation and you could possibly get colours in there. But it's no longer windows console any more than a tk application. The curses extension for windows should also have colours. IIRC it is possible to set colours using some Windows console API which is probably what win32console and pdcurses does. HTH Michal