From d9eb64928ec779fa6937a7fb196611ad7756a17c Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 23 Aug 2010 08:15:16 -0400 Subject: [PATCH] Fix home/end keys in repl for putty/xterm. --- lib/readline.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/readline.js b/lib/readline.js index b04b354ea8..e387194d6f 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