Skip to content

Commit 4b4d8cd

Browse files
committed
detect colors on not windows
1 parent d9648a1 commit 4b4d8cd

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Output/StreamOutput.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,17 @@ protected function hasColorSupport()
9595
return false;
9696
}
9797

98-
if (\DIRECTORY_SEPARATOR === '\\') {
99-
return (\function_exists('sapi_windows_vt100_support')
100-
&& @sapi_windows_vt100_support($this->stream))
101-
|| false !== getenv('ANSICON')
102-
|| 'ON' === getenv('ConEmuANSI')
103-
|| str_starts_with((string) getenv('TERM'), 'xterm');
98+
if (\DIRECTORY_SEPARATOR === '\\'
99+
&& \function_exists('sapi_windows_vt100_support')
100+
&& @sapi_windows_vt100_support($this->stream)
101+
) {
102+
return true;
104103
}
105104

106105
return 'Hyper' === getenv('TERM_PROGRAM')
106+
|| false !== getenv('ANSICON')
107+
|| 'ON' === getenv('ConEmuANSI')
108+
|| str_starts_with((string) getenv('TERM'), 'xterm')
107109
|| stream_isatty($this->stream);
108110
}
109111
}

0 commit comments

Comments
 (0)