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

cli: strip ansi from stderr if no support #2035

Merged
merged 10 commits into from Jun 9, 2022
Merged

cli: strip ansi from stderr if no support #2035

merged 10 commits into from Jun 9, 2022

Conversation

davidjgoss
Copy link
Contributor

@davidjgoss davidjgoss commented May 6, 2022

🤔 What's changed?

  • For the publish banner, check the colors support of stderr and adjust what we output accordingly
  • For the reports server output, check the colors support of stderr and strip ANSI escapes from the output if necessary

⚡️ What's your motivation?

Fixes #1698.

For stdout, this should be adequately covered by the changes in #2026. Also, there are known cases for users wanting to keep ANSI escapes from formatter output even though the stdout stream doesn't support displaying them (e.g. writing output to a file store and then streaming the contents back to the client application separately) which are also handled there.

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@davidjgoss davidjgoss marked this pull request as draft May 7, 2022 08:32
@coveralls
Copy link

coveralls commented May 30, 2022

Coverage Status

Coverage decreased (-0.04%) to 98.292% when pulling ee0d1a3 on fix/stderr-ansi into 00957f0 on main.

@davidjgoss davidjgoss marked this pull request as ready for review May 30, 2022 08:02
@davidjgoss
Copy link
Contributor Author

@aslakhellesoy all good with this?

Copy link
Contributor

@aurelien-reeves aurelien-reeves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👌

@davidjgoss davidjgoss merged commit 1e0831c into main Jun 9, 2022
@davidjgoss davidjgoss deleted the fix/stderr-ansi branch June 9, 2022 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strip ANSI colour escapes from STDOUT and STDERR when streams are not TTY
3 participants