8000 fix color detection · symfony/symfony@ccea2e1 · GitHub
[go: up one dir, main page]

Skip to content

Commit ccea2e1

Browse files
committed
fix color detection
1 parent fa7531f commit ccea2e1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ private static function hasColorSupport()
404404
}
405405

406406
if (!self::isTty()) {
407-
return true;
407+
return false;
408408
}
409409

410410
if ('\\' === \DIRECTORY_SEPARATOR

src/Symfony/Component/VarDumper/Dumper/CliDumper.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,12 @@ private function hasColorSupport($stream): bool
612612

613613
// Detect msysgit/mingw and assume this is a tty because detection
614614
// does not work correctly, see https://github.com/composer/composer/issues/9690
615-
if (!@stream_isatty($stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) {
616-
return true;
615+
if (!\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) {
616+
return false;
617+
}
618+
619+
if (!@stream_isatty(\STDOUT)) {
620+
return false;
617621
}
618622

619623
if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support($stream)) {

0 commit comments

Comments
 (0)
0