浏览代码

"run" commands close existing launched instances

lleaff 7 年之前
父节点
当前提交
6aab0be1d4
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/tool_manager.ts

+ 5 - 1
src/tool_manager.ts

@@ -196,7 +196,11 @@ class ToolManager {
     if (!fs.existsSync(editorPath) || !fs.statSync(editorPath).isFile()) {
       vscode.window.showErrorMessage("Invalid editor path to run the project");
     } else {
-      let terminal = vscode.window.createTerminal("Godot");
+      let existingTerminal = vscode.window.terminals.find(t => t._name === "GodotTools")
+      if (existingTerminal) {
+        existingTerminal.dispose()
+      }
+      let terminal = vscode.window.createTerminal("GodotTools");
       editorPath = this.escapeCmd(editorPath);
       let cmmand = `${editorPath} ${params}`;
       terminal.sendText(cmmand, true);