Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 6.4:
  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
  • Loading branch information
xabbuh committed Dec 10, 2023
2 parents cdce5c6 + 0254811 commit f8587c4
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions Output/StreamOutput.php
Expand Up @@ -94,18 +94,17 @@ protected function hasColorSupport(): bool
return false;
}

if ('Hyper' === getenv('TERM_PROGRAM')) {
if (\DIRECTORY_SEPARATOR === '\\'
&& \function_exists('sapi_windows_vt100_support')
&& @sapi_windows_vt100_support($this->stream)
) {
return true;
}

if (\DIRECTORY_SEPARATOR === '\\') {
return (\function_exists('sapi_windows_vt100_support')
&& @sapi_windows_vt100_support($this->stream))
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM');
}

return stream_isatty($this->stream);
return 'Hyper' === getenv('TERM_PROGRAM')
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| str_starts_with((string) getenv('TERM'), 'xterm')
|| stream_isatty($this->stream);
}
}

0 comments on commit f8587c4

Please sign in to comment.