| Recipe 23 | Get Good Text Output on Windows |
Problem
You’re running Cucumber on Windows and want the console output to be green or red based on the pass/fail status of the steps. You also want non-U.S. characters to show up correctly in the output.
Ingredients
-
ANSICON, a Windows helper for ANSI colored output[142]
-
Windows’s built-in chcp command for setting the code page[143]
-
The Consolas[144] or Lucida Console[145] font (both of which ship with recent Windows versions) for correctly displaying Unicode characters
-
Ruby 1.9.x, which handles Unicode better than 1.8.x
Solution
Most command-line environments support cursor movement and text coloring through ANSI escape codes,[146] sequences of special characters that a program can print as part ...