I have a command line program, which outputs logging to the screen.
I want error lines to show up in red. Is there some special character codes I can output to switc
You could use an ANSI escape sequence, but that won't do what you want under modern versions of Windows. Wikipedia has a very informative article:
http://en.wikipedia.org/wiki/ANSI_escape_code
So the answer to your original question is almost certainly "no." However, you can change the foreground color without writing an escape sequence, for example by invoking a Win32 API function. I don't know how to do this sort of thing in Ruby off the top of my head, but somebody else seems to have managed:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/241925
I imagine you'd want to use 4 for dark red or 12 for bright red, and 7 to restore the default color.
Hope this helps!