Skip to content

Commit c0cd6eb

Browse files
Merge branch '6.4' into 7.0
* 6.4: Skip Twig v3.9-dev for now [Validator] Update Dutch (nl) translation Update Albanian translations [Validator] Update translation [FrameworkBundle] Prevent silenced warning by checking if /proc/mount exists [VarDumper][PhpUnitBridge] Fix color detection prevent throwing NOT_FOUND error when tube is empty [Validator] Update missing validator translation for Swedish [FrameworkBundle] Fix eager-loading of env vars in ConfigBuilderCacheWarmer [Messenger] Fix failing Redis test [Validator] Update Italian (it) translations [Validator] Missing translations for Hungarian (hu) #53769 revert to native PHP union types [Validator] Missing translations for Russian (ru) #53775 fix syntax errors on PHP 7
2 parents e634943 + f9db2cc commit c0cd6eb

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

Dumper/CliDumper.php

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -590,19 +590,30 @@ private function hasColorSupport(mixed $stream): bool
590590
return false;
591591
}
592592

593-
if ('Hyper' === getenv('TERM_PROGRAM')) {
593+
// Detect msysgit/mingw and assume this is a tty because detection
594+
// does not work correctly, see https://github.com/composer/composer/issues/9690
595+
if (!@stream_isatty($stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) {
594596
return true;
595597
}
596598

597-
if (\DIRECTORY_SEPARATOR === '\\') {
598-
return (\function_exists('sapi_windows_vt100_support')
599-
&& @sapi_windows_vt100_support($stream))
600-
|| false !== getenv('ANSICON')
601-
|| 'ON' === getenv('ConEmuANSI')
602-
|| 'xterm' === getenv('TERM');
599+
if ('\\' === \DIRECTORY_SEPARATOR && @sapi_windows_vt100_support($stream)) {
600+
return true;
601+
}
602+
603+
if ('Hyper' === getenv('TERM_PROGRAM')
604+
|| false !== getenv('COLORTERM')
605+
|| false !== getenv('ANSICON')
606+
|| 'ON' === getenv('ConEmuANSI')
607+
) {
608+
return true;
609+
}
610+
611+
if ('dumb' === $term = (string) getenv('TERM')) {
612+
return false;
603613
}
604614

605-
return stream_isatty($stream);
615+
// See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157
616+
return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term);
606617
}
607618

608619
/**

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"symfony/http-kernel": "^6.4|^7.0",
2626
"symfony/process": "^6.4|^7.0",
2727
"symfony/uid": "^6.4|^7.0",
28-
"twig/twig": "^3.0.4"
28+
"twig/twig": "~3.8.0"
2929
},
3030
"conflict": {
3131
"symfony/console": "<6.4"

0 commit comments

Comments
 (0)