-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Disable colorization by default if output is not a text terminal #53
Comments
It worked like you described, but it was changed few versions ago because of PR or issue. |
I see in the CHANGELOG:
What were the discussions relevant to this decision? |
As you can see it was 3 years ago :) Can't find it, it was a PR or issue. |
@specious in case this bugs you on an ongoing basis: less knows how to interpret the codes if you start it with If this comes back, it would sure be nice to be able to override this again (kind of like |
Makes sense to me to go back to at least consider going back to the previous functionality. I don't think I've ever dumped If the PRs I submitted today look interesting to @fazibear and have a chance at getting merged in the next few months, then I might consider digging through the PR / issue history to look at when this was last working the way the issue asks in order to see if I can figure out how to restore the previous capability. No promises, but I get why this is valuable. (NOTE: yes, I definitely realize that this issue is now over 5 years old) |
FYI, the change was introduced in this PR: #2 |
@chocolateboy - thanks for finding that! I see this PR from the What's your take on #2 and the reason for removing this originally? I created a branch with this change on my fork to test. |
I think #2 should be opt-in (like |
By convention, I am used to colorized applications suppressing colorization when sending the output to a pipe, unless I explicitly force colorization.
For example, in colors.js:
Writing an app using
colorize
, I was surprised that colors were not suppressed when doingapp > file.txt
orapp | cat
. The color codes can cause problems in later processing stages.I then turned colorization off for non-TTY output with:
I'd like to propose that be the default behavior, with a way to force colors by choice in all cases.
The text was updated successfully, but these errors were encountered: