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
Usage with an external event loop #15
Comments
Funny, I'm actually working on exactly that right at this very moment! 😎 The interface is almost working and follows that of the GNU Readline API. Please stand by, will have something for your to test within a couple of days. |
There, please try it out if you have the chance. |
After reading the code, it seems to me that editline expects the user input to still be available in the stdin buffer.
If I set the terminal to So is there some way to have the readline() function take a buffer that contains the key presses, process those keypresses and return wether the line is complete (aka we should interpret the line) if it is still waiting for more input? |
I've never used libuv, only libev, libevent and my own libuev, so I cannot give any insight in how to integrate them. However, in addition to the standard GNU readline() "alternate interface" implementation, there are a few other tricks you can use:
The alternate interface requires that you call Good Luck! 😃 |
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
I am looking for a line editing library that I can use together with an event loop. That means no blocking readline function and no direct access to stdin.
Instead, I would call readline() with one or more the user pressed, readline should process these keys and return.
Is this possible with editline, or if not, could you give an estimate on how much work it would be to implement something like this?
The text was updated successfully, but these errors were encountered: