22 comments
I think this is #emacs super power. It provides a universal UI for all kinds of text. Files, shells, file browsers, REPLs for any language, email, RSS feeds etc. All with the same weird set of keybindings, and fully customizable . I can appreciate Emacs is not for everyone, but I don't know why other editors don't take this approach (or maybe they do?) @b0rk i actually didn't realize readline was something that got used in things like bash, or even really a library you can just use, i never thought too hard about why maybe a tool i wrote for work should have readline shoved into it... π€ @monorail I believe readline is GPL licensed (not LGPL) so to use readline you need to have a GPL compatible license @b0rk it's a strictly internal tool used by only people on my team, which i don't believe counts as "redistribution" for the purposes of GPL, but i'll make sure i take a look. thanks for the heads up :3 @b0rk "libedit (which is like readline but worse)" π I feel this in my bones though. I know it's a bad idea, but I've stayed on python3.10 specifically because 3.11 has transition to libedit and it's ruined my muscle memory. @christmastree it looks like if you go to python 3.13 you get a new (non-readline-based) interactive shell which seems to work much better than the libedit one https://docs.python.org/3.13/whatsnew/3.13.html#a-better-interactive-interpreter @fs111 hmm i guess I just don't really believe in modal editing in the readline context for some reason, like I love vim but somehow I just never want to use it to edit a 1-line command @b0rk I did not know about rlwrap. (I did know about readline, this image is great, and "readline but worse" is totally reasonable commentary) @ed1conf `rlwrap ed` is basically quick'n'dirty en/ex enhancements for `ed(1)`. I'm probably still going to just use vanilla ed(1), but having the arrow keys work was interesting. Once you're comfortable with @b0rk My personal taxonomy puts prompt_toolkit (the custom lib used by ipython) at the same level as readline and libedit. It's a reusable component, and it definitely aims to be the Python version of readline. I've used it to add line editing to a personal project and I quite like it. |
(describing readline keybindings as "those weird keyboard shortcuts from emacs" and libedit as "like readline but worse" is maybe questionable but that is how I feel about them)