Permalink
Browse files

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 .
  • Loading branch information...
fabpot committed Jul 3, 2018
2 parents be8feaf + 2ab7bcf commit ae0a69a767c2d090c27cead44dc5cab1bc944239
@@ -231,7 +231,8 @@ private static function hasColorSupport()
&& sapi_windows_vt100_support(STDOUT))
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM');
|| 'xterm' === getenv('TERM')
|| 'Hyper' === getenv('TERM_PROGRAM');
}
if (function_exists('stream_isatty')) {
@@ -98,7 +98,8 @@ protected function hasColorSupport()
&& @sapi_windows_vt100_support($this->stream))
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM');
|| 'xterm' === getenv('TERM')
|| 'Hyper' === getenv('TERM_PROGRAM');
}
if (function_exists('stream_isatty')) {
@@ -271,7 +271,7 @@ public function createProgressBar($max = 0)
{
$progressBar = parent::createProgressBar($max);
if ('\\' !== DIRECTORY_SEPARATOR) {
if ('\\' !== DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) {
$progressBar->setEmptyBarCharacter(''); // light shade character \u2591
$progressBar->setProgressCharacter('');
$progressBar->setBarCharacter(''); // dark shade character \u2593
@@ -484,7 +484,8 @@ private function hasColorSupport($stream)
&& @sapi_windows_vt100_support($stream))
|| false !== getenv('ANSICON')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM');
|| 'xterm' === getenv('TERM')
|| 'Hyper' === getenv('TERM_PROGRAM');
}
if (function_exists('stream_isatty')) {
@@ -513,7 +514,8 @@ private function isWindowsTrueColor()
{
$result = 183 <= getenv('ANSICON_VER')
|| 'ON' === getenv('ConEmuANSI')
|| 'xterm' === getenv('TERM');
|| 'xterm' === getenv('TERM')
|| 'Hyper' === getenv('TERM_PROGRAM');
if (!$result && PHP_VERSION_ID >= 70200) {
$version = sprintf(

0 comments on commit ae0a69a

Please sign in to comment.