Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cb3239f

Browse filesBrowse files
Merge branch '5.4' into 6.4
* 5.4: [PhpUnitBridge][VarDumper] fix color detection [CI] Make sure we preserve file->header when we run sync-translations.php Review validators.sl.xlf
2 parents faaaa5e + 8ec305a commit cb3239f
Copy full SHA for cb3239f

File tree

1 file changed

+3
-18
lines changed
Filter options

1 file changed

+3
-18
lines changed

‎Output/StreamOutput.php

Copy file name to clipboardExpand all lines: Output/StreamOutput.php
+3-18Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ protected function hasColorSupport(): bool
9797
return false;
9898
}
9999

100-
if (!$this->isTty()) {
100+
// Detect msysgit/mingw and assume this is a tty because detection
101+
// does not work correctly, see https://github.com/composer/composer/issues/9690
102+
if (!@stream_isatty($this->stream) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) {
101103
return false;
102104
}
103105

@@ -120,21 +122,4 @@ protected function hasColorSupport(): bool
120122
// See https://github.com/chalk/supports-color/blob/d4f413efaf8da045c5ab440ed418ef02dbb28bf1/index.js#L157
121123
return preg_match('/^((screen|xterm|vt100|vt220|putty|rxvt|ansi|cygwin|linux).*)|(.*-256(color)?(-bce)?)$/', $term);
122124
}
123-
124-
/**
125-
* Checks if the stream is a TTY, i.e; whether the output stream is connected to a terminal.
126-
*
127-
* Reference: Composer\Util\Platform::isTty
128-
* https://github.com/composer/composer
129-
*/
130-
private function isTty(): bool
131-
{
132-
// Detect msysgit/mingw and assume this is a tty because detection
133-
// does not work correctly, see https://github.com/composer/composer/issues/9690
134-
if (\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) {
135-
return true;
136-
}
137-
138-
return @stream_isatty($this->stream);
139-
}
140125
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.