From 380dce9a6b2886f1ff89103ea170092abe8866f5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 11 Nov 2020 16:30:50 +0100 Subject: [PATCH] Make sure the IO is not interactive when not run in a tty, refs #9454 --- src/Composer/Console/Application.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 192df31a0..cc7f61d9a 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -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); }