by emptybits · 8y ago · 0 comments
`if sys.stdout.isatty(): ...`
I recognize TTY != ANSI in some cases. And sometimes you actually want control sequences captured or redirected. So this is far from perfect but it might be good enough for some.
Such a check ports across systems well and doesn't rely on a new environment variable.
No comments yet.