Explorar o código

"run" commands close existing launched instances

lleaff %!s(int64=7) %!d(string=hai) anos
pai
achega
6aab0be1d4
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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()) {
     if (!fs.existsSync(editorPath) || !fs.statSync(editorPath).isFile()) {
       vscode.window.showErrorMessage("Invalid editor path to run the project");
       vscode.window.showErrorMessage("Invalid editor path to run the project");
     } else {
     } 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);
       editorPath = this.escapeCmd(editorPath);
       let cmmand = `${editorPath} ${params}`;
       let cmmand = `${editorPath} ${params}`;
       terminal.sendText(cmmand, true);
       terminal.sendText(cmmand, true);