-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected: 4.1.4
Description
When using \Symfony\Component\Console\OutputConsoleSectionOutput::clear()
after displaying a Question (regardless whether with or without \Symfony\Component\Console\Style\SymfonyStyle
) the last previous line of the section isn't cleared.
How to reproduce
class SomeCommand extends \Symfony\Component\Console\Command\Command
{
protected function execute(InputInterface $input, OutputInterface $output)
{
$section = $output->section();
$section->writeln('aaa');
$section->writeln('aaa');
// Output:
// aaa
// aaa
$question = new Question('???');
$questionHelper = new QuestionHelper();
$questionHelper->ask($input, $section, $question);
// Output:
// aaa
// aaa
// ???
$section->clear();
$section->writeln('bbb');
$section->writeln('bbb');
// Output:
// aaa
// bbb
// bbb
}
}
Possible Solution
I didn't found any.