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] fix clear of section with question#48897

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

Merged

Conversation

@maxbeckers
Copy link
Contributor

QA
Branch?6.2
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#47411
LicenseMIT
Doc PRn/a

This PR fixes the problems to clear a section with a question included.

Example Code:

    protected function execute(InputInterface $input, OutputInterface $output)    {        $section1 = $output->section();        $io = new SymfonyStyle($input, $section1);        $output->writeln("foo");        $countdown = 3;        while ($countdown > 0) {            $section1->clear();            $io->writeln('start ' . $countdown);            $io->write('foo');            $io->write(' and bar'.\PHP_EOL);            $givenAnswer = $io->ask('Dummy question?');            $section1->write('bar');            $countdown--;        }        return self::SUCCESS;    }

Output loop 1:
Screenshot 2023-01-06 142630

Output loop 1:
Screenshot 2023-01-06 142653

There was already afix#48089 to be merged in 6.1, but the problem was that there were some changes in 6.2, so it was not possible to merge it into 6.2.

So this fix is only working for 6.2, but perhaps we could find a solution as well for the older versions. But because of the changes of console it was not possible to find a solution working for all versions.

@chalasr this fix is still with the newline alwaystrue

parent::doWrite($deleteLastLine ?$lastLine.$message :$message,true);

A change of the newline to$newline would change the behavior. Maybe we could change that in symfony 7.

To make it easier to test is here a zip with 2 testcommands in the root and the changed vendors.
test-48089.zip

@chalasr
Copy link
Member

Thanks for fixing this bug@maxbeckers.

@chalasrchalasr merged commit57901a1 intosymfony:6.2Feb 19, 2023
@fabpotfabpot mentioned this pull requestFeb 28, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@maxheliasmaxheliasmaxhelias approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

4 participants

@maxbeckers@chalasr@maxhelias@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp