1
0
Fork 0

Make sure the IO is not interactive when not run in a tty, refs #9454

pull/9461/head
Jordi Boggiano 2020-11-11 16:30:50 +01:00
parent 87006774b1
commit 380dce9a6b
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 5 additions and 1 deletions

View File

@ -129,7 +129,11 @@ class Application extends BaseApplication
{
$this->disablePluginsByDefault = $input->hasParameterOption('--no-plugins');
if (getenv('COMPOSER_NO_INTERACTION')) {
if (
getenv('COMPOSER_NO_INTERACTION')
|| (function_exists('stream_isatty') && !stream_isatty(STDOUT))
|| (function_exists('posix_isatty') && !posix_isatty(STDOUT))
) {
$input->setInteractive(false);
}