1
0
Fork 0

Remove SignalHandler from Application to fix issues handling ctrl-C inside prompts

Fixes #12106
pull/12178/head
Jordi Boggiano 2024-10-28 16:30:35 +01:00
parent e12cfa0c40
commit 5c3f6e070d
No known key found for this signature in database
1 changed files with 0 additions and 11 deletions

View File

@ -19,7 +19,6 @@ use Composer\Util\Platform;
use Composer\Util\Silencer;
use LogicException;
use RuntimeException;
use Seld\Signal\SignalHandler;
use Symfony\Component\Console\Application as BaseApplication;
use Symfony\Component\Console\Exception\CommandNotFoundException;
use Symfony\Component\Console\Helper\HelperSet;
@ -84,9 +83,6 @@ class Application extends BaseApplication
*/
private $initialWorkingDirectory;
/** @var SignalHandler */
private $signalHandler;
public function __construct(string $name = 'Composer', string $version = '')
{
if (method_exists($this, 'setCatchErrors')) {
@ -108,12 +104,6 @@ class Application extends BaseApplication
$this->io = new NullIO();
$this->signalHandler = SignalHandler::create([SignalHandler::SIGINT, SignalHandler::SIGTERM, SignalHandler::SIGHUP], function (string $signal, SignalHandler $handler) {
$this->io->writeError('Received '.$signal.', aborting', true, IOInterface::DEBUG);
$handler->exitWithLastSignal();
});
if (!$shutdownRegistered) {
$shutdownRegistered = true;
@ -135,7 +125,6 @@ class Application extends BaseApplication
public function __destruct()
{
$this->signalHandler->unregister();
}
public function run(?InputInterface $input = null, ?OutputInterface $output = null): int