7

I'm trying to get colors to show up on my Windows 7 x64 machine when running rspec. I've tried console2 and ansicon but that makes Ruby crash. I've got ConEmu installed and Ruby runs again but I'm not getting any colors for rspec. Also in lines I expect to see color, they are preceded by text like [31m or [36m (this also occurs with cmd.exe).

Thanks for any help Sharon

Charles Roper
  • 20,125
  • 20
  • 71
  • 101
  • 1
    What I need to download and how to reproduce? Does in works with ansicon? Does "Inject ConEmuHk" checked? – Maximus Nov 09 '12 at 16:14
  • I can't even run rspec with aniscon, because Ruby crashes. Inject ConEmuHk is not checked. I have used RailsInstaller to install Ruby on rails(Ruby 1.9.3), Git and Ruby Dev kit. I run rspec using - bundle exec rspec spec/requests/static_pages_spec.rb – Sharon Dankwardt Nov 09 '12 at 17:14

1 Answers1

7

To enable ANSI X3.64 processing in ConEmu you must enable two options on "Features" page:

  • "Inject ConEmuHk"
  • "ANSI X3.64 / xterm 256 colors"

In fact, if you need ANSI processing in the root process only (cmd.exe for example) - there is no need in enabling "Inject ConEmuHk". But in most cases, when you run smth (which uses ANSI) from root shell - "Injects" are required.

ATM, latest alpha version recommended, there was some lags in the current stable build.

Maximus
  • 10,751
  • 8
  • 47
  • 65
  • I've got colors in Rspec but now I'm trying to use cucumber and have no colors in it. Any ideas? – Sharon Dankwardt Dec 03 '12 at 02:00
  • 1. Read my answer carefully. 2. If error still exist - describe it thoroughly. – Maximus Dec 03 '12 at 06:39
  • 2
    I have Inject ConEmuHk and ANSI X3.64/ xterm 256 colors checked. I get colors when running Rspec but not with Cucumber – Sharon Dankwardt Dec 05 '12 at 17:48
  • 1. What is 'Cucumber'? 2. What is in its output? 3. What did you do for "enabling colored output" in Cucumber? ATM I think you need to ask its author but not me. – Maximus Dec 05 '12 at 17:55
  • 2
    Thanks for pointing me in the right direction. Cucumber.yml needed the following lines: default: <%= std_opts %> features --color wip: --tags @wip:3 --wip features --color (added -- color) and it works fine now – Sharon Dankwardt Dec 05 '12 at 21:59
  • 1
    That is awesome, that ansicon was looking a bit of a pain. ConEmu saves the day! Thanks @Sharon for pointing out what to do with cucumber.yml - For reference, cucumber.yml goes in your working directory (wherever you run rake), and the <%= is for any other options you have - remove that if you don't actually have any other options... – Dave Arkell Feb 21 '13 at 11:28