From 6099f559b51b755e666926fdd527d669461dadc7 Mon Sep 17 00:00:00 2001 From: danielpinto8zz6 Date: Tue, 14 Feb 2023 02:13:27 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Add=20workaround=20to=20f?= =?UTF-8?q?ix=20external=20terminal=20on=20windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #308 --- src/runner.ts | 6 ++++-- src/terminal.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/runner.ts b/src/runner.ts index 22b508f..29e1252 100644 --- a/src/runner.ts +++ b/src/runner.ts @@ -118,10 +118,12 @@ export class Runner { } buildRunCommand(executable: string, args: string, customPrefix: string) { + const winTerminal: string = Configuration.winTerminal(); + const prefix = process.platform === "win32" && winTerminal !== "powershell.exe" && winTerminal !== "pwsh.exe" ? ".\\": "./"; if (customPrefix) { - return `${customPrefix} ${getRunPrefix()}"${executable}" ${args}`.trim(); + return `${customPrefix} ${prefix}"${executable}" ${args}`.trim(); } - return `${getRunPrefix()}\"${executable}\" ${args}`.trim(); + return `${prefix}\"${executable}\" ${args}`.trim(); } } diff --git a/src/terminal.ts b/src/terminal.ts index 2b4865b..0c577b4 100644 --- a/src/terminal.ts +++ b/src/terminal.ts @@ -182,7 +182,7 @@ export function getRunPrefix(): string { if (process.platform === "win32") { const shell = currentWindowsShell(); - if (shell === ShellType.cmd) { + if (shell === ShellType.cmd || shell === ShellType.powerShell) { return ".\\"; } }