Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Forced color output #326

Closed
Shamaoke opened this Issue · 2 comments

2 participants

@Shamaoke

Hi.

In versions of RSpec before 2.0 it was possible to pipe the color output to pagers or redirect it to a file. There's the RSPEC_COLOR environment variable for that purpose. However, now the usage of that variable is unsupported, the color tags is stripped in the mentioned conditions and the output in the Less or More pagers becomes monochrome. Also, there are no color tags in the output file.

I would like to have an ability to color the piped or redirected output. It can be realised by adding the --force-color option for example or may be better to not allow the present --color option to strip the color tags.

Thanks.

@Shamaoke

I tackled with the question.

In the RSpec versions after and including 2.0 it's configured through RSpec::Core::Configuration#tty= method.

RSpec.configure { |c| c.tty = true }
@franklinyu

Option --tty will do it. Put it in ~/.rspec if you want it globally.

@JonRowe JonRowe locked and limited conversation to collaborators
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Something went wrong with that request. Please try again.