public static streamSupportsAnsiColors ( mixed $stream ) : boolean | ||
$stream | mixed | |
return | boolean | true if the stream supports ANSI colors, otherwise false. |
public static function streamSupportsAnsiColors($stream)
{
return DIRECTORY_SEPARATOR === '\\' ? getenv('ANSICON') !== false || getenv('ConEmuANSI') === 'ON' : function_exists('posix_isatty') && @posix_isatty($stream);
}