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 <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Shobhit Chittora 2018-05-12 12:46:33 +05:30 committed by Ruben Bridgewater
parent 0c852a1795
commit eeb1d514ad
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -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