From 6aab0be1d4041a08d347118094f2e3d5e48beda6 Mon Sep 17 00:00:00 2001 From: lleaff Date: Wed, 10 Oct 2018 02:03:04 +0200 Subject: [PATCH] "run" commands close existing launched instances --- src/tool_manager.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tool_manager.ts b/src/tool_manager.ts index 291aaf0..b827813 100644 --- a/src/tool_manager.ts +++ b/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);