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

check for NO_COLORS before enabling colors #4

Open
Tracked by #5
naturallymitchell opened this issue Jan 27, 2019 · 1 comment
Open
Tracked by #5

check for NO_COLORS before enabling colors #4

naturallymitchell opened this issue Jan 27, 2019 · 1 comment

Comments

@naturallymitchell
Copy link
Member

use sys env vars according to https://no-color.org/ see jazzdotdev/jazz#162

@sineemore
Copy link

When standard output is a file handle (or a pipe) colors will be written directly to it, and now all your logs will be with escape sequences.

Colored output is only meaningful when outputting to terminal.
NO_COLOR is a way to tell program not to use colors in terminal.
But I guess log files should be without colors (escape sequences) anyway.

isatty(3) can be used to determine if a file descriptor refers to a terminal.

(btw, you can search GitHub for code with "isatty color" to reveal the problem.)

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

No branches or pull requests

2 participants