-
Notifications
You must be signed in to change notification settings - Fork 93
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
Consider using github.com/peterh/liner #7
Comments
It sounds interesting, thanks. I will have a look as soon as I have a little time |
I have the basics for this that I can donate. I had a look through what you have for reading lines, and I'm not entirely sure how it all works, so it's probably better if I give you the terminal code and you plug that in, unless you want to do it all your self. |
Here is a write up in case you want to pick up what I have (it is derived from code I originally wrote for cayley's REPL, but I am only pasting here what I have free rights to as their author). Relevant imports:
The initialisation of a terminal is done at the outset of the REPL shell with this snippet that handles history and signals (user warnings can be elided).
This is matched by an appropriate Then your REPL loop executes the following snippet to get lines. Handle the lines however you want after that. Since you change prompt depending on context, just update
The machinery:
|
Sorry for the late answer. |
Added in commit e224935 |
github.com/peterh/liner is a linenoise-like terminal implementation with features like history, line editing and autocompletion. Adding this to the repl would make it significantly easier to use.
The text was updated successfully, but these errors were encountered: