-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Enable color by default only if os.Stdout is a TTY #6696
Conversation
cli/util/color.go
Outdated
"github.com/mattn/go-isatty" | ||
) | ||
|
||
var DefaultColorUse = isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also have an env var for this? (LOTUS_COLOR=1
, or sth like that, unless there is already a standard env var for that kind of thing)
Just isatty.IsTerminal
will return false when running stuff in watch --color ..
for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So... we could introduce LOTUS_COLOR=1
OR we could recognize GOLOG_LOG_FMT=color
which is a thing from ipfs/go-log
I can go either way, just suggesting an alternative for smaller amount of options to keep track of...
@magik6k say the word
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Stebalien please be weighing in as well, I surely missed other stuff here too ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GOLOG_LOG_FMT
works for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@magik6k please be checking 4dd59b566ced
No description provided.