Skip to content
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

Adding --with-libedit to configure option affects the behaviour of readline() function. #497

Closed
shinnya opened this issue May 10, 2015 · 3 comments
Assignees
Labels

Comments

@shinnya
Copy link
Member

shinnya commented May 10, 2015

readline function implemented with libedit can't stop echoing user input. The code below should not display user input.

<?php    
`/bin/stty -echo`;    
$line = readline('> ');    
var_dump($line);    
`/bin/stty echo`;

This code works with libreadline, but doesn't work with libedit. As far as I searched, --with-libedit causes this issue.

Accordint to PHP doc, we can choose either --with-readline or --with-libedit for enabling readline, but the two options are given in phpbrew at the same time when +readline variant is enabled and phpbrew can find the headers of readline and libedit.
See

if ($prefix = Utils::findIncludePrefix('editline' . DIRECTORY_SEPARATOR . 'readline.h')) {
.

Is this code a bug? I think we should give either of them.

@shinnya shinnya added the Bug label May 10, 2015
@shinnya shinnya changed the title Adding --with-libedit to configure option affects the behavior of readline() function. Adding --with-libedit to configure option affects the behaviour of readline() function. May 10, 2015
@shinnya shinnya self-assigned this May 10, 2015
@shinnya
Copy link
Member Author

shinnya commented May 10, 2015

You can check which library you use by the following command:

$ php -i | grep EditLine

If you get no output, you're using libreadline.

@c9s
Copy link
Member

c9s commented May 17, 2015

CLIFramework 2.5.2 was released, which shall contain your commits. :)

c9s added a commit that referenced this issue May 4, 2016
because only readline supports readline_list_history()
(http://www.php.net/readline-list-history).  On the other hand we want
libedit to be the default because its license is compatible with PHP's
which means PHP can be distributable.

related issue #497

Add editline to readline conflict
@c9s
Copy link
Member

c9s commented May 4, 2016

It was using editline for historical reason about 4 years ago, it's now fixed to prefer readline over editline

@c9s c9s closed this as completed May 4, 2016
c9s added a commit that referenced this issue May 4, 2016
because only readline supports readline_list_history()
(http://www.php.net/readline-list-history).  On the other hand we want
libedit to be the default because its license is compatible with PHP's
which means PHP can be distributable.

related issue #497

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

No branches or pull requests

2 participants