summaryrefslogtreecommitdiff
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
parent41fc46e52ff8c0465800a35af1d1bda275e5d192 (diff)
downloadnode-new-18574bfaf1c408fd87b69fa4d041a9f3050d6754.tar.gz
readline: make `ctrl + L` clear the screen
-rw-r--r--lib/readline.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/readline.js b/lib/readline.js
index 83b425c4df..dbd83ea872 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;