Ctrl-U and other default bindings in the REPL are a bit counter-intuitive #20145
Labels
help wanted
Issues that need assistance from volunteers or PRs that need help to proceed.
readline
Issues and PRs related to the built-in readline module.
repl
Issues and PRs related to the REPL subsystem.
I'm not sure what library (or custom code) Node uses to handle line editing in the REPL, but being accustomed to Bash and GNU Readline (as most people probably are nowadays) some of the default bindings are a bit counter-intuitive.
The most egregious one being
Ctrl-U
, which in Node kills the whole line. In Bash and other Readline-based CLI,Ctrl-U
only kills the part of the line before the cursor, as a counterpart toCtrl-K
. I think this is a bad default binding, because a lot of people will haveCtrl-U
in their muscle memory and don't expect it to kill the whole line. The problem is compounded by the lack ofCtrl-Y
(see below) andCtrl-X Ctrl-U
, either of which would allow you to undo the change.Another different one is
Ctrl-W
, which in Node kills the last/\b/
-separated word, instead of the last/\s/
-separated word as it does in Bash / Readline. AlsoCtrl-Y
does not seem to yank the last killed string, which makes it impossible to move text around using the keyboard.I was just wondering if any thought had been given to following the Bash / Readline default bindings, because that's what most users are presumably used to. (I'm not saying Bash or Readline are better or more "right" than the alternatives, just that it's the most used shell in the most used OS for Node development.)
The text was updated successfully, but these errors were encountered: