summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémy Lal <kapouer@melix.org>2010-07-19 01:12:27 +0200
committerRyan Dahl <ry@tinyclouds.org>2010-07-18 22:20:23 -0700
commit0fd1656d63e5e1eb3048b718c53d35c6d5918846 (patch)
tree7e17b3ef562d341d6a18eb297ad51cae4125e10b
parent02746eddd6f789f0719a2ec627fe1c79d5a274c6 (diff)
downloadnode-new-0fd1656d63e5e1eb3048b718c53d35c6d5918846.tar.gz
Support DEL in the REPL.
-rw-r--r--lib/readline.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/readline.js b/lib/readline.js
index 9aab753611..c4751aa814 100644
--- a/lib/readline.js
+++ b/lib/readline.js
@@ -255,6 +255,11 @@ Interface.prototype._ttyWrite = function (b) {
this._historyPrev();
} else if (b[1] === 91 && b[2] === 66) { // down arrow
this._historyNext();
+ } else if (b[1] === 91 && b[2] === 51 && this.cursor < this.line.length) { // delete right
+ this.line = this.line.slice(0, this.cursor)
+ + this.line.slice(this.cursor+1, this.line.length)
+ ;
+ this._refreshLine();
}
break;