Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 86386d4 + 3da1077 commit ec17108Copy full SHA for ec17108
1 file changed
Output/StreamOutput.php
@@ -108,10 +108,22 @@ protected function hasColorSupport(): bool
108
return true;
109
}
110
111
- return 'Hyper' === getenv('TERM_PROGRAM')
+ if ('Hyper' === getenv('TERM_PROGRAM')
112
+ || false !== getenv('COLORTERM')
113
|| false !== getenv('ANSICON')
114
|| 'ON' === getenv('ConEmuANSI')
- || str_starts_with((string) getenv('TERM'), 'xterm');
115
+ ) {
116
+ return true;
117
+ }
118
+
119
+ $term = (string) getenv('TERM');
120
121
+ if ('dumb' === $term) {
122
+ return false;
123
124
125
+ // See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157
126
+ return 1 === @preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term);
127
128
129
/**
0 commit comments