src/Util/System/Linux.php
protected function systemHasAnsiSupport()
    {
        if ('Hyper' === getenv('TERM_PROGRAM')) {
            return true;
        }
        
        $stream = STDOUT;
        
        if (function_exists('stream_isatty')) {
            return @stream_isatty($stream);
        }

        if (function_exists('posix_isatty')) {
            return @posix_isatty($stream);
        }

        $stat = @fstat($stream);
        // Check if formatted mode is S_IFCHR
        return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
    }
protected function systemHasAnsiSupport()
    {
        if ('Hyper' === getenv('TERM_PROGRAM')) {
            return true;
        }
        
        $stream = STDOUT;
        
        if (function_exists('stream_isatty')) {
            return @stream_isatty($stream);
        }

        if (function_exists('posix_isatty')) {
            return @posix_isatty($stream);
        }

        $stat = @fstat($stream);
        // Check if formatted mode is S_IFCHR
        return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
    }
protected function systemHasAnsiSupport ( ) { if ( 'Hyper' === getenv ( 'TERM_PROGRAM' ) ) { return true ; } $ stream = STDOUT ; if ( function_exists ( 'stream_isatty' ) ) { return @ stream_isatty ( $ stream ) ; } if ( function_exists ( 'posix_isatty' ) ) { return @ posix_isatty ( $ stream ) ; } $ stat = @ fstat ( $ stream ) ; // Check if formatted mode is S_IFCHR return $ stat ? 0020000 === ( $ stat [ 'mode' ] & 0170000 ) : false ; }
Check if the stream supports ansi escape characters.

Based on https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Console/Output/StreamOutput.php

@return bool
Check if the stream supports ansi escape characters .