Skip to content

Commit d77ea48

Browse files
committed
bug #30883 [Console] Fix stty not reset when aborting in QuestionHelper::autocomplete() (Simperfit)
This PR was merged into the 3.4 branch. Discussion ---------- [Console] Fix stty not reset when aborting in QuestionHelper::autocomplete() | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #30861 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | none <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Commits ------- f54389b bugfix: the terminal state was wrong and not reseted
2 parents 0c8e8a5 + f54389b commit d77ea48

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Symfony/Component/Console/Helper/QuestionHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ private function autocomplete(OutputInterface $output, Question $question, $inpu
260260

261261
// as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false.
262262
if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) {
263+
shell_exec(sprintf('stty %s', $sttyMode));
263264
throw new RuntimeException('Aborted.');
264265
} elseif ("\177" === $c) { // Backspace Character
265266
if (0 === $numMatches && 0 !== $i) {

0 commit comments

Comments
 (0)