Commit cd476f09 authored by antoor's avatar antoor

Add load-cache features

增加加载缓存功能
parent 4c492378
...@@ -136,17 +136,16 @@ class Terminal { ...@@ -136,17 +136,16 @@ class Terminal {
if (cmd === 'exit' || cmd === 'quit') { return this.cell.close() }; if (cmd === 'exit' || cmd === 'quit') { return this.cell.close() };
term.pause(); term.pause();
// 是否有缓存 // 是否有缓存
if ((this.opts.otherConf || {})['terminal-cache'] === 1) { let cacheTag = 'command-' + new Buffer(this.path + cmd).toString('base64');
let cacheTag = 'command-' + new Buffer(this.path + cmd).toString('base64'); let cacheCmd = this.cache.get(cacheTag);
let cacheCmd; if (
if (cacheCmd = this.cache.get(cacheTag)) { (this.opts.otherConf || {})['terminal-cache'] === 1 && cacheCmd
term.echo( ) {
antSword.noxss(cacheCmd, false) term.echo(
); antSword.noxss(cacheCmd, false)
return term.resume(); );
}; return term.resume();
} };
// 开始执行命令 // 开始执行命令
this.core.request( this.core.request(
this.core.command.exec({ this.core.command.exec({
......
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