Skip to content

Commit 196e708

Browse files
azjezznicolas-grekas
authored andcommitted
Check for Hyper terminal on all operating systems.
1 parent 7f3aae0 commit 196e708

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy