Commit 65df7fcc authored by antoor's avatar antoor

Add custom-terminal-execPath features

增加终端自定义执行路径功能
parent 53a5c477
...@@ -134,7 +134,7 @@ class Terminal { ...@@ -134,7 +134,7 @@ class Terminal {
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() };
term.pause(); // term.pause();
// 是否有缓存 // 是否有缓存
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 = this.cache.get(cacheTag);
...@@ -146,11 +146,15 @@ class Terminal { ...@@ -146,11 +146,15 @@ class Terminal {
); );
return term.resume(); return term.resume();
}; };
// 获取自定义执行路径
let _bin = this.isWin ? 'cmd' : '/bin/sh';
let _confBin = (this.opts['otherConf'] || {})['command-path'];
_bin = _confBin || _bin;
// 开始执行命令 // 开始执行命令
this.core.request( this.core.request(
this.core.command.exec({ this.core.command.exec({
cmd: this.parseCmd(cmd, this.path), cmd: this.parseCmd(cmd, this.path),
bin: this.isWin ? 'cmd' : '/bin/sh' bin: _bin
}) })
).then((ret) => { ).then((ret) => {
let _ = ret['text']; let _ = ret['text'];
......
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