composer/getcomposer.org — pull request #54 by scy (2013-10-24 08:57:38+00:00)
Title: Installer using colors when it shouldn't

Currently, the `out()` function of the Composer installer checks whether it's on Windows and if not, ANSI escape codes will be output.

This looks nice on a Unix terminal, but I for example run the installer from a Jenkins job, and the console output will be displayed in my browser, with raw ANSI codes all over the place. It would be nice if the installer was a bit smarter when deciding whether to use colors or not, or at least let the user specify their preference.

My suggestion is to

1. introduce the parameters `--ansi` and `--no-ansi` to force-enable or -disable ANSI output and
2. (optionally) if the machine is not using Windows and neither of the new ANSI parameters is used, use PHP's `posix_isatty()` to decide whether stdout is a terminal and default to using colors only then.

If you agree that these changes would be nice, I can implement that and send you a pull request.