summaryrefslogtreecommitdiff
path: root/lib/readline.js
diff options
context:
space:
mode:
authorYuan Chuan <yuanchuan23@gmail.com>2013-06-15 15:48:36 +0800
committerBen Noordhuis <info@bnoordhuis.nl>2013-06-17 15:57:04 +0200
commit18574bfaf1c408fd87b69fa4d041a9f3050d6754 (patch)
tree2cf84a4d05030045326bba7d525ac5f04d2e75a1 /lib/readline.js
parent41fc46e52ff8c0465800a35af1d1bda275e5d192 (diff)
downloadnodejs-18574bfaf1c408fd87b69fa4d041a9f3050d6754.tar.gz
nodejs-18574bfaf1c408fd87b69fa4d041a9f3050d6754.tar.bz2
nodejs-18574bfaf1c408fd87b69fa4d041a9f3050d6754.zip
readline: make `ctrl + L` clear the screen
Diffstat (limited to 'lib/readline.js')
-rw-r--r--lib/readline.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/readline.js b/lib/readline.js
index 83b425c4d..dbd83ea87 100644
--- a/lib/readline.js
+++ b/lib/readline.js
@@ -663,6 +663,12 @@ Interface.prototype._ttyWrite = function(s, key) {
this._moveCursor(+1);
break;
+ case 'l': // clear the whole screen
+ exports.cursorTo(this.output, 0, 0);
+ exports.clearScreenDown(this.output);
+ this._refreshLine();
+ break;
+
case 'n': // next history item
this._historyNext();
break;