[Console] Ensure the console output is only detected as decorated when both stderr and stdout support colors
This commit is contained in:
parent
238531fea1
commit
f3d844434b
@ -48,7 +48,12 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
|
|||||||
{
|
{
|
||||||
parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter);
|
parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter);
|
||||||
|
|
||||||
|
$actualDecorated = $this->isDecorated();
|
||||||
$this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter());
|
$this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter());
|
||||||
|
|
||||||
|
if (null === $decorated) {
|
||||||
|
$this->setDecorated($actualDecorated && $this->stderr->isDecorated());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user