macbre/phantomas — pull request #415 by jart (2014-10-19 19:08:50+00:00)
Title: Check if stderr is a TTY for colors (not stdout)

Assume I were to run the following:

phantomas http://justinetunney.com --reporter=json | pretty-json >report.json

In this case, stderr would be a terminal (since I used `|` instead of `|&`) but stdout would not. Since logging is sent to stderr, one would assume it would continue to have ANSI colors. But this is not the case, because the code incorrectly tests the stdout file descriptor, rather than stderr.

This patch should makes things better for you guys. Please confirm that your project never emits ANSI colors to stdout before merging. Thanks in advance.