diff --git a/lib/readline.js b/lib/readline.js index 177bb5bde6..2b2c18c4f7 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -361,10 +361,10 @@ Interface.prototype._ttyWrite = function (b) { this.cursor++; this.output.write('\x1b[0C'); } - } else if (b[1] === 91 && b[2] === 72) { // home + } else if ((b[1] === 91 || b[1] === 79) && b[2] === 72) { // home this.cursor = 0; this._refreshLine(); - } else if (b[1] === 91 && b[2] === 70) { // end + } else if ((b[1] === 91 || b[1] === 79) && b[2] === 70) { // end this.cursor = this.line.length; this._refreshLine(); } else if (b[1] === 91 && b[2] === 65) { // up arrow