Commit 1bbc6c0c authored by antoor's avatar antoor

Add cls/clear features

增加清空屏幕命令
parent d865ff8f
...@@ -131,9 +131,11 @@ class Terminal { ...@@ -131,9 +131,11 @@ class Terminal {
// 初始化终端 // 初始化终端
this.term = dom.terminal( (cmd, term) => { this.term = dom.terminal( (cmd, term) => {
if (!cmd) { return false }; if (!cmd) { return false }
// 如果为exit||quit则关闭窗口 // 如果为exit||quit则关闭窗口
if (cmd === 'exit' || cmd === 'quit') { return this.cell.close() }; if (cmd === 'exit' || cmd === 'quit') { return this.cell.close() }
// clear清空
if (cmd === 'cls' || cmd === 'clear') { return term.clear() }
// term.pause(); // term.pause();
// 是否有缓存 // 是否有缓存
let cacheTag = 'command-' + new Buffer(this.path + cmd).toString('base64'); let cacheTag = 'command-' + new Buffer(this.path + cmd).toString('base64');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment