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
Prompting doesn't support arrow keys #996
Comments
Requires the readline library. |
@scribu I have php5-readline installed but I can't use the arrow keys as well. Is anything else necessary? |
Run |
|
@rodrigoprimo I'm still of the mind this is an application-level problem. Haven't had time to dive into it further. |
I think I found the source of the problem. Turns out php-cli-tools is not using using readline(), it uses fgets(STDIN) instead: https://github.com/wp-cli/php-cli-tools/blob/master/lib/cli/Streams.php#L130 The following seem to fix this issue:
But another problem is created, if you use the left arrow to go to the beginning of what you typed, the cursor goes to the beginning of the line, before the question presented to the user. I think this happens because readline() expects the question as a parameter. So we will need to change that as well. |
@rodrigoprimo can you file an issue in |
Sure: wp-cli/php-cli-tools#72 |
Trying to go to the beginning of the field instead produces unexpected characters:
Might be a problem upstream.
The text was updated successfully, but these errors were encountered: