Repository: composer/composer

Issue #8457: Composer crashing on any question prompt in PHP 7.4 for Windows
Created: 2019-11-29T12:46:07Z
My composer.json:
No composer.json file, crashes on composer init
Output of composer diagnose:
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 1.9.1
PHP version: 7.4.0
PHP binary path: C:\work\php\current\php.exe

When I run this command:
composer init
or any other command that does a question prompt

I get the following output:
[Symfony\Component\Console\Exception\RuntimeException] Aborted

With -vvv:
 Welcome to the Composer config generator  
                                            


This command will guide you through creating your composer.json config.

Package name (<vendor>/<name>) [patrik/antifraud]:
                                                          
  [Symfony\Component\Console\Exception\RuntimeException]  
  Aborted                                                 
                                                          

Exception trace:
 () at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/QuestionHelper.php:148
 Symfony\Component\Console\Helper\QuestionHelper->doAsk() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/QuestionHelper.php:75
 Symfony\Component\Console\Helper\QuestionHelper->Symfony\Component\Console\Helper\{closure}() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/QuestionHel
per.php:404
 Symfony\Component\Console\Helper\QuestionHelper->validateAttempts() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/QuestionHelper.php:78
 Symfony\Component\Console\Helper\QuestionHelper->ask() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/IO/ConsoleIO.php:267
 Composer\IO\ConsoleIO->askAndValidate() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Command/InitCommand.php:240
 Composer\Command\InitCommand->interact() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Command/Command.php:230
 Symfony\Component\Console\Command\Command->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Console/Application.php:267
 Composer\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Console/Application.php:106
 Composer\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/bin/composer:61
 require() at C:\ProgramData\ComposerSetup\bin\composer.phar:24

And I expected this to happen:
Expected being able to enter an answer to the prompt.
If I switch to PHP 7.3 everything is working.
If I run the same command with PHP 7.4 in Linux everything is working.

Duplicate issue #7056: Composer init is failing without any reason.
Created: 2018-01-29T14:32:29Z
Output of composer diagnose:
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: 
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 1.6.2
PHP version: 7.0.27-0+deb9u1
PHP binary path: /usr/bin/php7.0


When I run this command:
bruno@debian:~/Documents/php/tester/testpkg$ composer init

I get the following output:

                                            
  Welcome to the Composer config generator  
                                            


This command will guide you through creating your composer.json config.

Package name (<vendor>/<name>) [bruno/testpkg]: 
                                                          
  [Symfony\Component\Console\Exception\RuntimeException]  
  Aborted                                                 
                                                          

init [--name NAME] [--description DESCRIPTION] [--author AUTHOR] [--type [TYPE]] [--homepage HOMEPAGE] [--require REQUIRE] [--require-dev REQUIRE-DEV] [-s|--stability STABILITY] [-l|--license LICENSE] [--repository REPOSITORY]

And I expected this to happen:
Package name (<vendor>/<name>) [bruno/testpkg]: <me entering some input>
... etc

The directory is empty.
ls -mod outputs:  drwxr-xr-x 2 bruno 4096 Jan 29 12:27 .

Closing comment (2019-12-02T17:39:58Z): That issue is a duplicate of #8457