diff options
author | Yuan Chuan <yuanchuan23@gmail.com> | 2013-06-15 15:48:36 +0800 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-06-17 15:57:04 +0200 |
commit | 18574bfaf1c408fd87b69fa4d041a9f3050d6754 (patch) | |
tree | 2cf84a4d05030045326bba7d525ac5f04d2e75a1 /lib/readline.js | |
parent | 41fc46e52ff8c0465800a35af1d1bda275e5d192 (diff) | |
download | nodejs-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.js | 6 |
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; |