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

Don't output colors if output is being redirect #59

Closed
marcospb19 opened this issue Oct 5, 2021 · 0 comments · Fixed by #60
Closed

Don't output colors if output is being redirect #59

marcospb19 opened this issue Oct 5, 2021 · 0 comments · Fixed by #60
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@marcospb19
Copy link
Member

By using atty we can easily check if the STDOUT stream is pointing to another file descriptor.

Currently, redirecting ouch output to a file makes it unreadable in a lot of programs, as terminal escape sequences are only interpreted by terminals, and only by some tools (may work with cat, but not with less or bat).

Unresolved questions:

  1. Should we add an --color flag to overwrite this behavior (and the NO_COLOR env var)?

Also, because we are already talking about colors.

  1. We could also add --no-color flag to deactivate colors, maybe you are using a terminal that's not working properly with it?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant