You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #38991 [Console] Fix ANSI when stdErr is not a tty (jderusse)
This PR was merged into the 4.4 branch.
Discussion
----------
[Console] Fix ANSI when stdErr is not a tty
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#38981
| License | MIT
| Doc PR | -
Taking the @wouterj 's comment into account (#38981 (comment))
This PR prevents using the same Formatter for stdOut and stdErr when possible.
When user send a custom formatter (or call `setFormatter`) the previous logic is kept.
Otherwise, symfony is asked to create the Formatter, and thus is able to clone the formatter.
In a future PR targeting 5.3, we could improve the constructor to let people inject 2 distinguished formatters
Commits
-------
f3a398b Fix ANSI when stdErr is not a tty
$this->assertEquals(Output::VERBOSITY_QUIET, $output->getVerbosity(), '__construct() takes the verbosity as its first argument');
25
-
$this->assertSame($output->getFormatter(), $output->getErrorOutput()->getFormatter(), '__construct() takes a formatter or null as the third argument');
25
+
$this->assertNotSame($output->getFormatter(), $output->getErrorOutput()->getFormatter(), 'ErrorOutput should use it own formatter');
0 commit comments