3 ms·
> A NO_COLOR flag is not perfect but better than nothing and easier to implement than theme or interactivity detection Is checking an environment variable that
by messe 5y ago
> A NO_COLOR flag is not perfect but better than nothing and easier to implement than theme or interactivity detection
Is checking an environment variable that much easier than an isatty(3) call? I'm concerned that if this becomes widely implemented, developers will try using it as a poor substitute for isatty.
- mrighele 5y agoFor me no, but I think it depends a lot on the experience of the developer and the language it is using. And environment variable is more common knowledge, it's cross platform and supported in any decent language. I bet that many don't even know that something like isatty(3) exists.
- zinekeller 5y ago> I bet that many don't even know that something like isatty(3) exists. Also shell scripts can't directly use that.
- messe 5y agoSure, and that's why POSIX provides `test -t`.