From 18574bfaf1c408fd87b69fa4d041a9f3050d6754 Mon Sep 17 00:00:00 2001 From: Yuan Chuan Date: Sat, 15 Jun 2013 15:48:36 +0800 Subject: [PATCH] readline: make `ctrl + L` clear the screen --- lib/readline.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/readline.js b/lib/readline.js index 83b425c4df2..dbd83ea872c 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;