-
Notifications
You must be signed in to change notification settings - Fork 6
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
Implement readline functionality for line editing #6
Comments
i have absolutely no idea what this means, give examples of what my program does not do that this does. |
In the context of text editing, "readline motions" typically refer to the movement commands used in the GNU Readline library. Readline is a software library for creating text-based user interfaces, and it is widely used in command-line interfaces for tasks like text editing. Here are some common readline motions:
|
whats an example of a program that implements these properly? i want to test some edge cases for defining what to cut when you are in the middle of a word for ctrl+w and alt+t implemented all but alt+d, ctrl+w, alt+t, ctrl+xx(that one confuses me also) of the listed stuff 939486a |
Most terminal emulators implement these motions personally I don't mind if they're not there since I don't really use them. If I were making a cli program I would probably try to use the GNU readline library instead of implementing the motions myself from scratch but I don't have much experience with rust so I wouldn't know how to do that. EDIT: There are probably rust libraries that function as a readline alternative so you could try using those btw this is a great project I use this regularly keep up the good work. |
the problem with just using readline like normal is i dont think i can work with a real time output while preserving everything |
Maybe, if I find the time I'll try to implement it myself but it could be more work than just doing it from scratch so that might be the best approach. |
Apologies @bgkillas that I couldn't reply earlier. Virtually every terminal/command-line application (from the most famous to the most obscure) typically provides readline motions, and is a de-facto standard feature expected.# Readline is such a ubiquitous library and language bindings or native implementations are available for almost any language you can name. For rust, have a look at the crates: https://crates.io/crates/reedline and https://crates.io/crates/rustyline |
I'll try to work on this a bit as well |
Any updates on this? |
ill add the keybinds mentioned above in my todo list, dont know how long it will be since i dont care about them, shouldn't be too hard so i will do it eventually. i still believe that it isn't plausible to use a crate, even if it is it would almost definitely require thousands of lines of refactoring, and likely would hold caveats. |
my goal is by the weekend i guess since i want to make another release then |
okay finished the above mentioned keybinds in master, not the escape aliases since crossterm does not support esc as a modifier |
Great work on the
kalc
terminal calculator application. I am thoroughly enjoying it.However, one dampener on the user experience is that there is no support for readline motions on the command line. This makes it really tedious to edit and move around to edit the expression to be calculated. Nearly every reasonable CLI program has a readline-like feature (it is almost a given), and I hope that
kalc
also implements this feature soon.Once again, congrats on making this impressive and useful application.
The text was updated successfully, but these errors were encountered: