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

Respect $TERM #50

Closed
robnagler opened this issue Dec 27, 2016 · 1 comment
Closed

Respect $TERM #50

robnagler opened this issue Dec 27, 2016 · 1 comment

Comments

@robnagler
Copy link
Contributor

It would be wonderful if you could turn off color like @mjibson did in cortesi/termlog#3. I don't develop with go, but it seems like his change is a good compromise to respect $TERM without breaking backwards compatibility:

var NoColor = !isatty.IsTerminal(os.Stdout.Fd()) || os.Getenv("TERM") == "dumb"

Anybody who sets TERM=dumb is actively trying to communicate with programs that the output is not a terminal which seems in line with the IsTerminal() test.

Please tell others about how to respect $TERM, thanks!

@fatih
Copy link
Owner

fatih commented Dec 28, 2016

I think this wouldn't break anything. If you open a PR I'm happy to merge it. Thanks.

@fatih fatih closed this as completed in #51 Dec 28, 2016
zimbatm pushed a commit to direnv/direnv that referenced this issue Mar 24, 2017
* Only output color if $TERM is not dumb
Probably should use github.com/fatih/color
Broken, sorry, b/c I don't know how to integrate "go get" in Makefile
I'm not a go programmer. :(
See fatih/color#50
Visit respectmyterm.com to learn why
Thanks!

* remove dependency on isatty
isatty isn't really relevant here. All we really want
is to be able to control the color by setting TERM=dumb
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