Closed charlesroper closed 13 years ago
Actually the problem comes from this commit http://github.com/grosser/autotest/commit/d827a4a5004ae3d89be45b61422ad500c79d4f52 where the putc was replaced by print. When you replace it back, the coloring will work. I have no idea for what purpose it was changed ...
I also have this problem and changing print to putc fixed it for me.
The problem about using print vs putc is because print fixes the output of UTF strings, something that getc
will actually corrupt from input (try pass specs with accented characters in it).
Either way, please see the RubyInstaller thread about deprecating win32console support:
http://groups.google.com/group/rubyinstaller/browse_thread/thread/2d2a62db7281509a/
Does this bug effect other OSes? I get no colours in Debian (but I do in Mac OS X).
It could, that depends on your current encoding of the terminal and the version of Ruby you're using.
For example, usage of accented characters inside autotest could generate broken output due the usage of getc
to get a single byte and usage of print
to output it.
the original change was a refactoring for more readability, i reverted this and added a comment (how to test this ?)
You need Windows :P
But basically using putc with single characters (like it used to do) should fix this.
Autotest is not starting win32console on Windows and so it renders a bunch on escape codes to the screen instead of colours. Rspec handles it like this:
http://github.com/dchelimsky/rspec/blob/master/lib/spec/runner/options.rb#L187
While in Rails itself, I add the following to config/environments/development.rb:
http://gist.github.com/306678