Skip to content

Issues with the new "readline" support for QuestionHelper #15583

Closed
@javiereguiluz

Description

@javiereguiluz

Symfony added "readline" support for console in #15382. The feature works OK when using the arrow keys, but it suffers some issues:

  1. It doesn't limit the arrow keys movement:

console_readline_3

  1. If you delete or type new characters after arrow key movements, this happens:

console_readline

console_readline_2


This is the test script that I used with symfony/console 2.8.x@dev:

require_once __DIR__.'/vendor/autoload.php';

use Symfony\Component\Console\Question\Question;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;

$helper = new QuestionHelper();
$question = new Question('Enter the name of the bundle: ', '');
$bundle = $helper->ask(new ArgvInput(), new ConsoleOutput(), $question);

My readline configuration:

php_readline

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions