Skip to content

Commit 2ab7bcf

Browse files
azjezzfabpot
authored andcommitted
Add color support for Hyper terminal .
1 parent be8feaf commit 2ab7bcf

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ private static function hasColorSupport()
231231
&& sapi_windows_vt100_support(STDOUT))
232232
|| false !== getenv('ANSICON')
233233
|| 'ON' === getenv('ConEmuANSI')
234-
|| 'xterm' === getenv('TERM');
234+
|| 'xterm' === getenv('TERM')
235+
|| 'Hyper' === getenv('TERM_PROGRAM');
235236
}
236237

237238
if (function_exists('stream_isatty')) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ protected function hasColorSupport()
9898
&& @sapi_windows_vt100_support($this->stream))
9999
|| false !== getenv('ANSICON')
100100
|| 'ON' === getenv('ConEmuANSI')
101-
|| 'xterm' === getenv('TERM');
101+
|| 'xterm' === getenv('TERM')
102+
|| 'Hyper' === getenv('TERM_PROGRAM');
102103
}
103104

104105
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) {
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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,8 @@ private function hasColorSupport($stream)
484484
&& @sapi_windows_vt100_support($stream))
485485
|| false !== getenv('ANSICON')
486486
|| 'ON' === getenv('ConEmuANSI')
487-
|| 'xterm' === getenv('TERM');
487+
|| 'xterm' === getenv('TERM')
488+
|| 'Hyper' === getenv('TERM_PROGRAM');
488489
}
489490

490491
if (function_exists('stream_isatty')) {
@@ -513,7 +514,8 @@ private function isWindowsTrueColor()
513514
{
514515
$result = 183 <= getenv('ANSICON_VER')
515516
|| 'ON' === getenv('ConEmuANSI')
516-
|| 'xterm' === getenv('TERM');
517+
|| 'xterm' === getenv('TERM')
518+
|| 'Hyper' === getenv('TERM_PROGRAM');
517519

518520
if (!$result && PHP_VERSION_ID >= 70200) {
519521
$version = sprintf(

0 commit comments

Comments
 (0)