Skip to content

Commit f3d8444

Browse files
committed
[Console] Ensure the console output is only detected as decorated when both stderr and stdout support colors
1 parent 238531f commit f3d8444

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Console/Output/ConsoleOutput.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = nu
4848
{
4949
parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter);
5050

51+
$actualDecorated = $this->isDecorated();
5152
$this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter());
53+
54+
if (null === $decorated) {
55+
$this->setDecorated($actualDecorated && $this->stderr->isDecorated());
56+
}
5257
}
5358

5459
/**

0 commit comments

Comments
 (0)