[Console] Ensure the console output is only detected as decorated when both stderr and stdout support colors

This commit is contained in:
Jordi Boggiano 2015-09-12 19:34:25 +01:00
parent 238531fea1
commit f3d844434b
1 changed files with 5 additions and 0 deletions

View File

@ -48,7 +48,12 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
{
parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter);
$actualDecorated = $this->isDecorated();
$this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter());
if (null === $decorated) {
$this->setDecorated($actualDecorated && $this->stderr->isDecorated());
}
}
/**