4 ms·
“rule 5.1: Ctrl-W should delete the last word […] I can’t think of any exceptions to this other than text editors but if there are I’d love to hear about them!”
by Sesse__ 2y ago
“rule 5.1: Ctrl-W should delete the last word
[…]
I can’t think of any exceptions to this other than text editors but if there are I’d love to hear about them!”
mysql(1) only links to editline instead of readline, where Ctrl-W by default deletes everything to the start of the line, not just the last word. It drove me mad in the period where I had to use it; you just see your entire nice query disappear. :-)
- saghm 2y agoIt could be worse! Back in college, I had the misfortune to decide to try to use sqlplus, Oracle's CLI to try to connect to their database. Not only did terminal shortcuts like Ctrl-W not work at all, but you couldn't even move the cursor earlier in the line, and there was no history navigation to get to the previous command, so any typo forced you to retype the entire thing from scratch. Entering a single forward slash would allow you to run the last command verbatim, but that didn't help with typos. Ctrl-L also didn't work for clearing the screen, but you could manually run `clear scr` to do it instead, because I guess having the command just be `clear` wouldn't be obvious enough.
- cafard 2y agoSQL*Plus is pretty basic, but L will show you the previous command, a number will give you that line of the previous command, to edit, etc.
- Sesse__ 2y agoIf you ever need to do so again, try gqlplus, which wraps sqlplus to add such quality-of-life features :-)
- kps 2y agoIt could be worse! You could be using an un‐configurable modern browser or some such thing where attempting to erase a word closes your tab.
- emmelaich 2y agoPretty sure Oracle's SQLplus supported the `e` command for a long time. Which invokes $EDITOR on last command. On Unixes of course, don't know what VMS/MVS/.... did.
- saghm 2y agoInteresting! Too bad my googling didn't come up with that, since it was not at all easy to discover anything from within the shell.