From f3d844434b2ad4d88273266fff388854406ec5af Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 12 Sep 2015 19:34:25 +0100 Subject: [PATCH] [Console] Ensure the console output is only detected as decorated when both stderr and stdout support colors --- src/Symfony/Component/Console/Output/ConsoleOutput.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Symfony/Component/Console/Output/ConsoleOutput.php b/src/Symfony/Component/Console/Output/ConsoleOutput.php index 50ef4df900..04bd51b782 100644 --- a/src/Symfony/Component/Console/Output/ConsoleOutput.php +++ b/src/Symfony/Component/Console/Output/ConsoleOutput.php @@ -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()); + } } /**