summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChandra Sekar S <chandru.in@gmail.com>2010-07-26 12:08:37 +0530
committerRyan Dahl <ry@tinyclouds.org>2010-07-26 10:59:34 -0700
commit66deea10c7bca2fe9c6b82495d141f0faf227216 (patch)
treeccc812c915e52093ec908d24848c027ad38d1fe7 /lib
parent6fdb874e2e9aa335eca2c6aacfb598f0c945575e (diff)
downloadnode-new-66deea10c7bca2fe9c6b82495d141f0faf227216.tar.gz
Support for HOME and END in REPL.
Diffstat (limited to 'lib')
-rw-r--r--lib/readline.js6
1 files changed, 6 insertions, 0 deletions
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