File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/Symfony/Component/Console/Output Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1313
1414use Symfony \Component \Console \Exception \InvalidArgumentException ;
1515use Symfony \Component \Console \Formatter \OutputFormatterInterface ;
16+ use function str_ends_with ;
1617
1718/**
1819 * StreamOutput writes the output to a given stream.
@@ -106,10 +107,18 @@ protected function hasColorSupport()
106107 return true ;
107108 }
108109
109- return 'Hyper ' === getenv ('TERM_PROGRAM ' )
110+ if ('Hyper ' === getenv ('TERM_PROGRAM ' )
111+ || false !== getenv ('COLORTERM ' )
110112 || false !== getenv ('ANSICON ' )
111113 || 'ON ' === getenv ('ConEmuANSI ' )
112- || str_starts_with ((string ) getenv ('TERM ' ), 'xterm ' );
114+ ) {
115+ return true ;
116+ }
117+
118+ $ term = (string ) getenv ('TERM ' );
119+
120+ return str_ends_with ($ term , 'screen ' )
121+ || str_ends_with ($ term , 'xterm ' );
113122 }
114123
115124 /**
You can’t perform that action at this time.
0 commit comments