Check for Hyper terminal on all operating systems.

This commit is contained in:
Saif Eddin Gmati 2018-07-03 17:28:18 +02:00 committed by Nicolas Grekas
parent 7f3aae010b
commit 196e708b68
4 changed files with 16 additions and 7 deletions

View File

@ -226,13 +226,16 @@ class DeprecationErrorHandler
return false; return false;
} }
if ('Hyper' === getenv('TERM_PROGRAM')) {
return true;
}
if (DIRECTORY_SEPARATOR === '\\') { if (DIRECTORY_SEPARATOR === '\\') {
return (function_exists('sapi_windows_vt100_support') return (function_exists('sapi_windows_vt100_support')
&& sapi_windows_vt100_support(STDOUT)) && sapi_windows_vt100_support(STDOUT))
|| false !== getenv('ANSICON') || false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI') || 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM') || 'xterm' === getenv('TERM');
|| 'Hyper' === getenv('TERM_PROGRAM');
} }
if (function_exists('stream_isatty')) { if (function_exists('stream_isatty')) {

View File

@ -93,13 +93,16 @@ class StreamOutput extends Output
*/ */
protected function hasColorSupport() protected function hasColorSupport()
{ {
if ('Hyper' === getenv('TERM_PROGRAM')) {
return true;
}
if (DIRECTORY_SEPARATOR === '\\') { if (DIRECTORY_SEPARATOR === '\\') {
return (function_exists('sapi_windows_vt100_support') return (function_exists('sapi_windows_vt100_support')
&& @sapi_windows_vt100_support($this->stream)) && @sapi_windows_vt100_support($this->stream))
|| false !== getenv('ANSICON') || false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI') || 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM') || 'xterm' === getenv('TERM');
|| 'Hyper' === getenv('TERM_PROGRAM');
} }
if (function_exists('stream_isatty')) { if (function_exists('stream_isatty')) {

View File

@ -271,7 +271,7 @@ class SymfonyStyle extends OutputStyle
{ {
$progressBar = parent::createProgressBar($max); $progressBar = parent::createProgressBar($max);
if ('\\' !== DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) { if ('\\' !== DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) {
$progressBar->setEmptyBarCharacter('░'); // light shade character \u2591 $progressBar->setEmptyBarCharacter('░'); // light shade character \u2591
$progressBar->setProgressCharacter(''); $progressBar->setProgressCharacter('');
$progressBar->setBarCharacter('▓'); // dark shade character \u2593 $progressBar->setBarCharacter('▓'); // dark shade character \u2593

View File

@ -479,13 +479,16 @@ class CliDumper extends AbstractDumper
return false; return false;
} }
if ('Hyper' === getenv('TERM_PROGRAM')) {
return true;
}
if (DIRECTORY_SEPARATOR === '\\') { if (DIRECTORY_SEPARATOR === '\\') {
return (function_exists('sapi_windows_vt100_support') return (function_exists('sapi_windows_vt100_support')
&& @sapi_windows_vt100_support($stream)) && @sapi_windows_vt100_support($stream))
|| false !== getenv('ANSICON') || false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI') || 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM') || 'xterm' === getenv('TERM');
|| 'Hyper' === getenv('TERM_PROGRAM');
} }
if (function_exists('stream_isatty')) { if (function_exists('stream_isatty')) {