From eeb1d514ad4a650f134b23b3eef3c854d0bc48a6 Mon Sep 17 00:00:00 2001 From: Shobhit Chittora Date: Sat, 12 May 2018 12:46:33 +0530 Subject: [PATCH] repl: changes ctrl+u to delete from cursor to line start Closes: #20145 PR-URL: https://github.com/nodejs/node/pull/20686 Fixes: https://github.com/nodejs/node/issues/20145 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Gus Caplan Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater --- lib/readline.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/readline.js b/lib/readline.js index 89dd1b84f2dde0..835741a41a6c54 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -800,10 +800,8 @@ Interface.prototype._ttyWrite = function(s, key) { } break; - case 'u': // delete the whole line - this.cursor = 0; - this.line = ''; - this._refreshLine(); + case 'u': // delete from current to start of line + this._deleteLineLeft(); break; case 'k': // delete from current to end of line