diff --git a/lib/readline.js b/lib/readline.js index b04b354ea82..e387194d6fc 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -389,12 +389,14 @@ Interface.prototype._ttyWrite = function (b) { } } else if ((b[1] === 91 && b[2] === 72) || (b[1] === 79 && b[2] === 72) || - (b[1] === 91 && b[2] === 55)) { // home + (b[1] === 91 && b[2] === 55) || + (b[1] === 91 && b[2] === 49 && (b[3] && b[3] === 126))) { // home this.cursor = 0; this._refreshLine(); } else if ((b[1] === 91 && b[2] === 70) || (b[1] === 79 && b[2] === 70) || - (b[1] === 91 && b[2] === 56)) { // end + (b[1] === 91 && b[2] === 56) || + (b[1] === 91 && b[2] === 52 && (b[3] && b[3] === 126))) { // end this.cursor = this.line.length; this._refreshLine(); } else if (b[1] === 91 && b[2] === 65) { // up arrow