9

I've recently started doing some ruby on rails development on Windows 7 and have found a number of commands (rspec, guard, etc) output colour codes that just show up in text on the windows command line (or through Console2 which I use). eg:

←[31mrspec ./spec/views/users/index.html.erb_spec.rb:21←[0m ←[36m# users/index renders a list of users←[0m
←[31mrspec ./spec/requests/homes_spec.rb:9←[0m ←[36m# Homes GET /homes ←[0m
←[31mrspec ./spec/views/users/new.html.erb_spec.rb:13←[0m ←[36m# users/new renders new user form←[0m
←[31mrspec ./spec/views/users/show.html.erb_spec.rb:13←[0m ←[36m# users/show renders attributes in <p>←[0m

I'm aware you can turn the color off for most tools by taking the --color command out out of the config files (e.g. the .respc file), but it's a pain to have to do this for everything and colour coding would be nice.

Any ideas how I can get these to display properly in Windows?

Charles Roper
  • 20,125
  • 20
  • 71
  • 101
Ben
  • 1,767
  • 16
  • 32

2 Answers2

12
  1. Change Console2 to ConEmu (I'm the author of this console). It supports Ansi x3.64

  2. Or, you may use AnsiCon to enable Ansi

Maximus
  • 10,751
  • 8
  • 47
  • 65
  • I couldn't get AnsiCon to work but ConEmu seems like a great little tool and get's the colours working perfectly, nice work. And thanks for the answer :-) – Ben Jul 31 '12 at 16:48
  • 1
    Note: The "Inject ConEmuHk" setting must be checked if you want ANSI color to work with second-level processes. – JustinStolle Apr 13 '13 at 21:08
2

I use Console2 ( http://sourceforge.net/projects/console/ ) with ansicon ( https://github.com/adoxa/ansicon ) and it work well :

  1. compile or download dll from author : http://ansicon.adoxa.cjb.net/ and put it in a repertory include in your path ;
  2. In console, launch ansicon : ansicon -i
Traz
  • 329
  • 1
  • 8