From 66deea10c7bca2fe9c6b82495d141f0faf227216 Mon Sep 17 00:00:00 2001 From: Chandra Sekar S Date: Mon, 26 Jul 2010 12:08:37 +0530 Subject: [PATCH] Support for HOME and END in REPL. --- lib/readline.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/readline.js b/lib/readline.js index d2d3f11383..75ccf23e3d 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -251,6 +251,12 @@ Interface.prototype._ttyWrite = function (b) { this.cursor++; this.output.write('\x1b[0C'); } + } else if (b[1] === 91 && b[2] === 72) { // home + this.cursor = 0; + this._refreshLine(); + } else if (b[1] === 91 && b[2] === 70) { // end + this.cursor = this.line.length; + this._refreshLine(); } else if (b[1] === 91 && b[2] === 65) { // up arrow this._historyPrev(); } else if (b[1] === 91 && b[2] === 66) { // down arrow