From e30b1735488155b71e57f5746b936bb7fa14ed9e Mon Sep 17 00:00:00 2001 From: Joinyy Date: Sat, 14 Aug 2021 12:24:45 +0200 Subject: [PATCH 1/2] Add setting to reuse an existing terminal window. --- package.json | 5 +++++ src/extension.ts | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/package.json b/package.json index f170606..fdbbfba 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,11 @@ "Use the preview version of Windows Terminal" ] }, + "windowsTerminal.reuseExistingWindow": { + "type": "boolean", + "default": false, + "description": "Whether to reuse an existing Windows Terminal window." + }, "windowsTerminal.explorer.showOpen": { "type": "boolean", "default": true, diff --git a/src/extension.ts b/src/extension.ts index 2366b46..8c718b1 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -39,12 +39,18 @@ async function refreshInstallation(force: boolean = false) { } async function openWindowsTerminal(profile: IWTProfile, uri?: vscode.Uri) { + const config = vscode.workspace.getConfiguration('windowsTerminal'); + const reuseWindow = config.get('reuseExistingWindow'); + await refreshInstallation(); if (!installation) { return; } const args = ['-p', profile.name]; + if (reuseWindow) { + args.splice(0, 0, '-w', '0'); + } // If there is no URI, set it to the first workspace folder if (!uri) { From 3d53665f82144e45204c7c170a0702db8c6cb4a1 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Thu, 21 Oct 2021 07:17:09 -0700 Subject: [PATCH 2/2] Make reuseExistingWindow the default --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fdbbfba..c251d6f 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ }, "windowsTerminal.reuseExistingWindow": { "type": "boolean", - "default": false, + "default": true, "description": "Whether to reuse an existing Windows Terminal window." }, "windowsTerminal.explorer.showOpen": {