Skip to content

Commit

Permalink
Have runInTerminal use windowsExec inside WSL
Browse files Browse the repository at this point in the history
Fixes #167865
  • Loading branch information
Tyriar committed Jan 11, 2023
1 parent 89e4272 commit cad710e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/vs/platform/externalTerminal/node/externalTerminalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,14 @@ export class LinuxExternalTerminalService extends ExternalTerminalService implem
}

public runInTerminal(title: string, dir: string, args: string[], envVars: ITerminalEnvironment, settings: IExternalTerminalSettings): Promise<number | undefined> {

const execPromise = settings.linuxExec ? Promise.resolve(settings.linuxExec) : LinuxExternalTerminalService.getDefaultTerminalLinuxReady();
let execPromise: Promise<string>;
if (process.env.WSL_DISTRO_NAME) {
execPromise = Promise.resolve(settings.windowsExec || 'cmd.exe');
} else if (settings.linuxExec) {
execPromise = Promise.resolve(settings.linuxExec);
} else {
execPromise = LinuxExternalTerminalService.getDefaultTerminalLinuxReady();
}

return new Promise<number | undefined>((resolve, reject) => {

Expand Down

0 comments on commit cad710e

Please sign in to comment.