Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Console] Handle signals on text input#61878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@valx76
Copy link

QA
Branch?7.4
Bug fix?no
New feature?yes
Deprecations?no
Issues
LicenseMIT

QuestionHelper is blocking signals because of itsfgets/fgetc use.
This PR usesfread so signals can be dispatched in text inputs.
Since Windows is not supported by the PCNTL extension, it was working fine on this OS.

Note

This change has been tested in Windows, Linux and MacOS.


Snippet to test the behavior manually:

useSymfony\Component\Console\Attribute\Argument;useSymfony\Component\Console\Attribute\AsCommand;useSymfony\Component\Console\Command\Command;useSymfony\Component\Console\Helper\QuestionHelper;useSymfony\Component\Console\Input\InputInterface;useSymfony\Component\Console\Output\OutputInterface;useSymfony\Component\Console\Question\Question;#[AsCommand(name:'app:test')]class TestCommand{publicfunction__invoke(InputInterface$input,OutputInterface$output,        #[Argument('Mode (single / multi)')]string$mode ='single'    ):int {$question =newQuestion('Enter text:');$question->setMultiline($mode !=='single');$helper =newQuestionHelper();$result =$helper->ask($input,$output,$question);$output->writeln('Result:'.$result);return Command::SUCCESS;    }}

Usage:

  • Single line input:php bin/console app:test single
  • Multiline input:php bin/console app:test multi

@valx76
Copy link
Author

Closing this while waiting for#61861 to be merged.
As discussed with@nicolas-grekas, I'll create a new one afterwards and set it as bugfix instead.

@valx76valx76 closed thisSep 29, 2025
@valx76valx76 deleted the feature/handle-signals-on-text-input branchOctober 5, 2025 18:22
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

7.4

Development

Successfully merging this pull request may close these issues.

3 participants

@valx76@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp