10000 bug #27794 Add color support for Hyper terminal . (azjezz) · symfony/symfony@ae0a69a · GitHub
[go: up one dir, main page]

Skip to content

Commit ae0a69a

Browse files
committed
bug #27794 Add color support for Hyper terminal . (azjezz)
This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #27794). Discussion ---------- Add color support for Hyper terminal . | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Added color support for [Hyper terminal](https://hyper.is), also shade characters support for progress bar. ![image](https://user-images.githubusercontent.com/29315886/42135797-6edb8492-7d50-11e8-968b-2dd19981dcdd.png) Commits ------- 2ab7bcf Add color support for Hyper terminal .
2 parents be8feaf + 2ab7bcf commit ae0a69a

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)
0