Skip to content

Commit

Permalink
fix: πŸ› Add workaround to fix external terminal on windows
Browse files Browse the repository at this point in the history
βœ… Closes: #308
  • Loading branch information
danielpinto8zz6 committed Feb 14, 2023
1 parent 69fce66 commit 6099f55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
2 changes: 1 addition & 1 deletion src/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ".\\";
}
}
Expand Down

0 comments on commit 6099f55

Please sign in to comment.