Skip to content

Commit 4496b59

Browse files
committed
minor #52942 Refactor hyper check location (theofidry)
This PR was merged into the 5.4 branch. Discussion ---------- Refactor hyper check location | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | None | License | MIT Extracted from #52940 to reduce the noise of that PR. There is no logic change, only a potentially a performance (I assume non-existent given it's a if check of a constant). If it is a concern however, this could be checked _before_ the windows specific checks. Commits ------- 9c09e16 refactor: hyper check
2 parents 8d06a8a + 9c09e16 commit 4496b59

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ protected function hasColorSupport()
9898
return false;
9999
}
100100

101-
if ('Hyper' === getenv('TERM_PROGRAM')) {
102-
return true;
103-
}
104-
105101
if (\DIRECTORY_SEPARATOR === '\\') {
106102
return (\function_exists('sapi_windows_vt100_support')
107103
&& @sapi_windows_vt100_support($this->stream))
@@ -110,6 +106,7 @@ protected function hasColorSupport()
110106
|| 'xterm' === getenv('TERM');
111107
}
112108

113-
return stream_isatty($this->stream);
109+
return 'Hyper' === getenv('TERM_PROGRAM')
110+
|| stream_isatty($this->stream);
114111
}
115112
}

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