Skip to content

Commit f34b1f2

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: fix merge [VarDumper] Test intl formatter broken since dumper does not replace the nnbsp character by standard space [WebProfilerBundle] Fix intercept external redirects [Webhook] Added missing XML attribute in config XSD [String] Skip a test when an issue is detected in PCRE2 [ExpressionLanguage] Fix null coalescing propagation [Mailer] Stop using the (local) AWS shared configuration in the PHPUnit tests. detect colors on not windows fix xterm detection refactor: hyper check Missing translations for Slovak (sk) #51954 Remove redundant PHPdoc line properly handle SYMFONY_DOTENV_VARS being the empty string Avoid incompatibility with symfony/console 7 bug #45057 [Messenger] Avoid reconnecting active Redis connections. [HttpKernel] Catch `TypeError` if the wrong type is used in `BackedEnumValueResolver` [Serializer] fix regression where nullable int cannot be serialized do not overwrite an application's default serialization context
2 parents 46ea62a + f8587c4 commit f34b1f2

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Output/StreamOutput.php

+9-10
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,17 @@ protected function hasColorSupport(): bool
9494
return false;
9595
}
9696

97-
if ('Hyper' === getenv('TERM_PROGRAM')) {
97+
if (\DIRECTORY_SEPARATOR === '\\'
98+
&& \function_exists('sapi_windows_vt100_support')
99+
&& @sapi_windows_vt100_support($this->stream)
100+
) {
98101
return true;
99102
}
100103

101-
if (\DIRECTORY_SEPARATOR === '\\') {
102-
return (\function_exists('sapi_windows_vt100_support')
103-
&& @sapi_windows_vt100_support($this->stream))
104-
|| false !== getenv('ANSICON')
105-
|| 'ON' === getenv('ConEmuANSI')
106-
|| 'xterm' === getenv('TERM');
107-
}
108-
109-
return stream_isatty($this->stream);
104+
return 'Hyper' === getenv('TERM_PROGRAM')
105+
|| false !== getenv('ANSICON')
106+
|| 'ON' === getenv('ConEmuANSI')
107+
|| str_starts_with((string) getenv('TERM'), 'xterm')
108+
|| stream_isatty($this->stream);
110109
}
111110
}

0 commit comments

Comments
 (0)