fix: 修复了如果通过 newcommand 创建命令,会出现页面无法点击的 bug

This commit is contained in:
fofolee 2021-03-27 19:36:25 +08:00
parent c61bdd02be
commit 2dede09285

View File

@ -389,7 +389,8 @@ if (process.platform == 'win32') quickcommand.runVbs = function (script) {
// 在终端中执行
if (process.platform !== 'linux') quickcommand.runInTerminal = function (cmdline, dir) {
let command = getCommandToLaunchTerminal(cmdline, dir)
let command = getCommandToLaunchTerminal(cmdline.replace(/"/g, `\\"`), dir)
console.log(command);
child_process.exec(command)
}
@ -412,7 +413,6 @@ let getCommandToLaunchTerminal = (cmdline, dir) => {
iterm = 'iTerm'
}
if (dir) cd = `cd ${dir.replace(/ /g, `\\\\ `)} &&`
cmdline = cmdline.replace(/"/g, `\\"`)
if (iterm) {
command = `osascript -e 'tell application "${iterm}"
create window with default profile