Skip to content

Commit d96cc7c

Browse files
azjezznicolas-grekas
authored andcommitted
Check for Hyper terminal on all operating systems.
1 parent 1dea8ac commit d96cc7c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

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')) {

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

0 commit comments

Comments
 (0)