1
0
Fork 0

Auto-detect mingw and assume it is interactive, fixes #9690

pull/9735/head
Jordi Boggiano 2021-02-23 13:10:48 +01:00
parent 057006da4f
commit 31d9f51572
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 0 deletions

View File

@ -96,6 +96,12 @@ class Platform
$fd = defined('STDOUT') ? STDOUT : fopen('php://stdout', 'w');
}
// detect msysgit/mingw and assume this is a tty because detection
// does not work correctly, see https://github.com/composer/composer/issues/9690
if (in_array(strtoupper(getenv('MSYSTEM')), array('MINGW32', 'MINGW64'), true)) {
return true;
}
// modern cross-platform function, includes the fstat
// fallback so if it is present we trust it
if (function_exists('stream_isatty')) {