File tree 1 file changed +11
-2
lines changed
src/Symfony/Component/Console/Output
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 13
13
14
14
use Symfony \Component \Console \Exception \InvalidArgumentException ;
15
15
use Symfony \Component \Console \Formatter \OutputFormatterInterface ;
16
+ use function str_ends_with ;
16
17
17
18
/**
18
19
* StreamOutput writes the output to a given stream.
@@ -106,10 +107,18 @@ protected function hasColorSupport()
106
107
return true ;
107
108
}
108
109
109
- return 'Hyper ' === getenv ('TERM_PROGRAM ' )
110
+ if ('Hyper ' === getenv ('TERM_PROGRAM ' )
111
+ || false !== getenv ('COLORTERM ' )
110
112
|| false !== getenv ('ANSICON ' )
111
113
|| '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 ' );
113
122
}
114
123
115
124
/**
You can’t perform that action at this time.
0 commit comments