mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
win10下支持带颜色输出
This commit is contained in:
@@ -32,6 +32,8 @@ class Stream
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* @param $stream
|
||||
* @param Formatter $formatter
|
||||
*/
|
||||
public function __construct($stream, Formatter $formatter = null)
|
||||
{
|
||||
@@ -180,8 +182,12 @@ class Stream
|
||||
*/
|
||||
protected function hasColorSupport()
|
||||
{
|
||||
if (DIRECTORY_SEPARATOR == '\\') {
|
||||
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
|
||||
if (DIRECTORY_SEPARATOR === '\\') {
|
||||
return
|
||||
0 >= version_compare('10.0.10586', PHP_WINDOWS_VERSION_MAJOR . '.' . PHP_WINDOWS_VERSION_MINOR . '.' . PHP_WINDOWS_VERSION_BUILD)
|
||||
|| false !== getenv('ANSICON')
|
||||
|| 'ON' === getenv('ConEmuANSI')
|
||||
|| 'xterm' === getenv('TERM');
|
||||
}
|
||||
|
||||
return function_exists('posix_isatty') && @posix_isatty($this->stream);
|
||||
|
||||
Reference in New Issue
Block a user