You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the rationale, please read this article: Color and TTYs.
The reality is that assuming that a terminal supports ANSI color codes is a bad idea for a bunch of reasons.
The most important reason is that the file descriptor you're printing to might not be a TTY. This commonly happens when stdout is redirected to another program or a file. If you emit ANSI escape codes then the output is no longer "plain text" and it makes a bunch of common operations more difficult. It can break programs like grep if the search term spans escape codes. It also causes weird things to happen when you use programs like less (which will escape the escape codes by default).
For the rationale, please read this article: Color and TTYs.
In Deno, we can detect if it's a TTY or not using
Deno.stdout.isTerminal()
method.The text was updated successfully, but these errors were encountered: