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

Hide color escape chars in non-TTY #164

Open
iSarCasm opened this issue Dec 7, 2022 · 1 comment
Open

Hide color escape chars in non-TTY #164

iSarCasm opened this issue Dec 7, 2022 · 1 comment

Comments

@iSarCasm
Copy link

iSarCasm commented Dec 7, 2022

Currently, out-of-the-box super_diff will continue using colors in non-TTY environments such as CircleCI, etc.

To avoid this, one can simply modify spec_helper.rb like this:

unless config.color
    SuperDiff.configure do |config|
      config.actual_color = :white
      config.expected_color = :white
      config.border_color = :white
      config.header_color = :white
    end
end

Ideally, this gem should automatically detect this case.

I can try and open a PR once confirmed

@mcmire
Copy link
Owner

mcmire commented Dec 7, 2022

Thanks for reporting this. We are doing some detection already here. I suppose for some reason I opted to enable colors on CI. We could remove that part of the logic though. Note that not all colors are getting disabled, so there is more we have to do to get rid of color completely — that is logged in #82 — but removing ENV["CI"] would be a start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants