Skip to content

Commit db5dd7b

Browse files
bug #27831 Check for Hyper terminal on all operating systems. (azjezz)
This PR was squashed before being merged into the 2.8 branch (closes #27831). Discussion ---------- Check for Hyper terminal on all operating systems. | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT return true if the terminal is Hyper.is on all operating systems not limited to windows. Commits ------- 196e708 Check for Hyper terminal on all operating systems.
2 parents 7f3aae0 + 196e708 commit db5dd7b

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,16 @@ private static function hasColorSupport()
226226
return false;
227227
}
228228

229+
if ('Hyper' === getenv('TERM_PROGRAM')) {
230+
return true;
231+
}
232+
229233
if (DIRECTORY_SEPARATOR === '\\') {
230234
return (function_exists('sapi_windows_vt100_support')
231235
&& sapi_windows_vt100_support(STDOUT))
232236
|| false !== getenv('ANSICON')
233237
|| 'ON' === getenv('ConEmuANSI')
234-
|| 'xterm' === getenv('TERM')
235-
|| 'Hyper' === getenv('TERM_PROGRAM');
238+
|| 'xterm' === getenv('TERM');
236239
}
237240

238241
if (function_exists('stream_isatty')) {

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,16 @@ protected function doWrite($message, $newline)
9393
*/
9494
protected function hasColorSupport()
9595
{
96+
if ('Hyper' === getenv('TERM_PROGRAM')) {
97+
return true;
98+
}
99+
96100
if (DIRECTORY_SEPARATOR === '\\') {
97101
return (function_exists('sapi_windows_vt100_support')
98102
&& @sapi_windows_vt100_support($this->stream))
99103
|| false !== getenv('ANSICON')
100104
|| 'ON' === getenv('ConEmuANSI')
101-
|| 'xterm' === getenv('TERM')
102-
|| 'Hyper' === getenv('TERM_PROGRAM');
105+
|| 'xterm' === getenv('TERM');
103106
}
104107

105108
if (function_exists('stream_isatty')) {

src/Symfony/Component/Console/Style/SymfonyStyle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public function createProgressBar($max = 0)
271271
{
272272
$progressBar = parent::createProgressBar($max);
273273

274-
if ('\\' !== DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) {
274+
if ('\\' !== DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) {
275275
$progressBar->setEmptyBarCharacter(''); // light shade character \u2591
276276
$progressBar->setProgressCharacter('');
277277
$progressBar->setBarCharacter(''); // dark shade character \u2593

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,13 +479,16 @@ private function hasColorSupport($stream)
479479
return false;
480480
}
481481

482+
if ('Hyper' === getenv('TERM_PROGRAM')) {
483+
return true;
484+
}
485+
482486
if (DIRECTORY_SEPARATOR === '\\') {
483487
return (function_exists('sapi_windows_vt100_support')
484488
&& @sapi_windows_vt100_support($stream))
485489
|| false !== getenv('ANSICON')
486490
|| 'ON' === getenv('ConEmuANSI')
487-
|| 'xterm' === getenv('TERM')
488-
|| 'Hyper' === getenv('TERM_PROGRAM');
491+
|| 'xterm' === getenv('TERM');
489492
}
490493

491494
if (function_exists('stream_isatty')) {

0 commit comments

Comments
 (0)