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

Appearance settings

Moved question prompt to readline() function #16458

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Moved question prompt to readline() function #16458

wants to merge 2 commits into from

Conversation

jaytaph
Copy link
Contributor

@jaytaph jaytaph commented Nov 4, 2015

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #15583
License MIT
Doc PR

This PR fixes the issue as described in #15583 by capturing the output of writePrompt() and passing this as the actual prompt in the readline() method. This way, all readline functionality (cursus movements, screen redraws and screen resizing) will work as expected.

@@ -172,7 +173,11 @@ protected function writePrompt(OutputInterface $output, Question $question)
$message = $question->getPrompt();
}

$output->write($message);
if ($this->inputStream == STDIN && function_exists('readline')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be strict (===) comparison and yoda (see 440 line).

@OskarStark
Copy link
Contributor

could you please add a test for this bugfix?

@jaytaph
Copy link
Contributor Author

jaytaph commented Nov 4, 2015

@OskarStark I'm not 100% sure how to add a test-case for this.

@OskarStark
Copy link
Contributor

i'am not sure, too, but maybe anyone else can help or give you a tipp

ping @javiereguiluz

@stof
Copy link
Member

stof commented Nov 4, 2015

this is broken in case the message is decorated

@fabpot
Copy link
Member

fabpot commented Jan 25, 2016

@jaytaph Any news on this one?

@jaytaph
Copy link
Contributor Author

jaytaph commented Jan 26, 2016

@fabpot @stof is right. It will break decorated messages (as they are not parsed through the decorators).

I'm not 100% sure if that is (easily) fixable though, as readline will print the message directly and cannot use the decorators, so either it's using undecorated questions, or have incorrect prompt behaviour.

I'm happy to change the PR if somebody find other solutions (for instance, if we could pass the prompt through decorators first, but i'm not 100% sure if that is possible).

Still leaves the issue open of testing, which i'm not sure if that is actually feasible.

@fabpot
Copy link
Member

fabpot commented Jan 26, 2016

Would it be better to revert readline support in the meantime? ping @javiereguiluz

@javiereguiluz
Copy link
Member

Sadly, I think so. Right now it doesn't work properly.

@xabbuh
Copy link
Member

xabbuh commented Feb 3, 2016

I agree. Let's remove readline support for now until someone comes up with a thorough fix for this issue.

@xabbuh
Copy link
Member

xabbuh commented Feb 3, 2016

closing in favour of #17669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.