{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/20145","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/20145/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/20145/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/20145/events","html_url":"https://github.com/nodejs/node/issues/20145","id":315812137,"number":20145,"title":"Ctrl-U and other default bindings in the REPL are a bit counter-intuitive","user":{"login":"tobia","id":48756,"avatar_url":"https://avatars2.githubusercontent.com/u/48756?v=4","gravatar_id":"","url":"https://api.github.com/users/tobia","html_url":"https://github.com/tobia","followers_url":"https://api.github.com/users/tobia/followers","following_url":"https://api.github.com/users/tobia/following{/other_user}","gists_url":"https://api.github.com/users/tobia/gists{/gist_id}","starred_url":"https://api.github.com/users/tobia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobia/subscriptions","organizations_url":"https://api.github.com/users/tobia/orgs","repos_url":"https://api.github.com/users/tobia/repos","events_url":"https://api.github.com/users/tobia/events{/privacy}","received_events_url":"https://api.github.com/users/tobia/received_events","type":"User","site_admin":false},"labels":[{"id":151728677,"url":"https://api.github.com/repos/nodejs/node/labels/help%20wanted","name":"help wanted","color":"159818","default":true},{"id":155435874,"url":"https://api.github.com/repos/nodejs/node/labels/readline","name":"readline","color":"d4c5f9","default":false},{"id":155435882,"url":"https://api.github.com/repos/nodejs/node/labels/repl","name":"repl","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-19T10:09:54Z","updated_at":"2018-04-19T10:49:35Z","closed_at":null,"author_association":"NONE","body":"* **Version**: v10.0.0-nightly20180419bbdb4af0bd\r\n* **Platform**: Linux 4.10.0-42-generic 46~16.04.1-Ubuntu SMP Mon Dec 4 15:57:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\nI'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.\r\n\r\nThe 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 to `Ctrl-K`. I think this is a bad default binding, because a lot of people will have `Ctrl-U` in their muscle memory and don't expect it to kill the whole line. The problem is compounded by the lack of `Ctrl-Y` (see below) and `Ctrl-X Ctrl-U`, either of which would allow you to undo the change.\r\n\r\nAnother 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. Also `Ctrl-Y` does not seem to yank the last killed string, which makes it impossible to move text around using the keyboard.\r\n\r\nI 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.)"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/382692108","html_url":"https://github.com/nodejs/node/issues/20145#issuecomment-382692108","issue_url":"https://api.github.com/repos/nodejs/node/issues/20145","id":382692108,"user":{"login":"bnoordhuis","id":275871,"avatar_url":"https://avatars0.githubusercontent.com/u/275871?v=4","gravatar_id":"","url":"https://api.github.com/users/bnoordhuis","html_url":"https://github.com/bnoordhuis","followers_url":"https://api.github.com/users/bnoordhuis/followers","following_url":"https://api.github.com/users/bnoordhuis/following{/other_user}","gists_url":"https://api.github.com/users/bnoordhuis/gists{/gist_id}","starred_url":"https://api.github.com/users/bnoordhuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bnoordhuis/subscriptions","organizations_url":"https://api.github.com/users/bnoordhuis/orgs","repos_url":"https://api.github.com/users/bnoordhuis/repos","events_url":"https://api.github.com/users/bnoordhuis/events{/privacy}","received_events_url":"https://api.github.com/users/bnoordhuis/received_events","type":"User","site_admin":false},"created_at":"2018-04-19T10:49:35Z","updated_at":"2018-04-19T10:49:35Z","author_association":"MEMBER","body":"Pull requests welcome, I'd say.\r\n\r\n> Ctrl-U only kills the part of the line before the cursor\r\n\r\nI think that's an acceptable change.\r\n\r\n> Also Ctrl-Y does not seem to yank the last killed string\r\n\r\n`readline` doesn't have a concept of yank buffers.  Some discussion is probably necessary on how to add that.  It should gel well with the public API.\r\n\r\n> 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.\r\n\r\nFWIW, that's a deliberate change because you often type `obj.wrong^Wright`.  Vim works the same way."}}
{"actor":{"display_login":"bnoordhuis"}}