Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forced color output #326

Closed
Shamaoke opened this issue Feb 24, 2011 · 2 comments
Closed

Forced color output #326

Shamaoke opened this issue Feb 24, 2011 · 2 comments

Comments

@Shamaoke
Copy link

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
Copy link
Author

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
Copy link

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

@rspec rspec locked and limited conversation to collaborators Mar 29, 2015
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants