-
Notifications
You must be signed in to change notification settings - Fork 178
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
Integration with termion (or any other terminal abstraction) #199
Comments
I regret to say that May also be related to how the screen is refreshed by You can also try to replace the current |
Oh sorry, I didn't get the notification of you edit! Ok so, both The "problems" both libraries have are:
The Most of the time the editor's contents renders fine, but the position of the cursor (caret) is never where expected. I'm using Termion's commands to "save" and "restore" the cursor position (all of my custom rendering happens in between those two codes), but this doesn't appear to have any effect. If I just don't print anything from my worker thread, then everything works fine (well, except the positioning issue, but that's not a deal breaker). I'm also using I'm going to checkout |
@mandx I don't know how to synchronise multiple outputs. |
Yes, this makes sense. Well, then I guess that what's left for my to try is something like this, which involves switching to In any case, thanks you for your replies. I was insisting on Rustyline, because it has all the nice features I would want for a proper REPL and a nice API. I will definitely use it in the future for "less crazy" stuff. Thanks for all your work! |
I absolutely love how RustyLine works; by itself it's pretty much perfect. However, I have no clue on how to integrate it with termion or any other terminal abstraction utilities.
The application I'm developing uses termion to create an
AlternateScreen
(so the previous screen is preserved after my app exits); my idea is to have RustyLine take over the bottom/top section of that screen (whatever number of lines it needs, as long as I can tell how many lines it's taking), and have another thread asynchronously render something else on the rest of the screen, mostly some processing results using rustyline's output as its input.Blindly creating an editor instance and launching it produces no crash, but the screen is a mess, (the prompt always renders fine, though).
Should I be synchronizing writes to
stdout
? FWIW, rustyline would be the only element taking input, there is no "widget focus" management at all.The text was updated successfully, but these errors were encountered: