We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 11bb928 commit bf283f0Copy full SHA for bf283f0
src/features/execution/runAsTask.ts
@@ -25,8 +25,12 @@ export async function runAsTask(
25
): Promise<TaskExecution> {
26
const workspace: WorkspaceFolder | TaskScope = getWorkspaceFolderOrDefault(options.project?.uri);
27
28
- const executable =
+ let executable =
29
environment.execInfo?.activatedRun?.executable ?? environment.execInfo?.run.executable ?? 'python';
30
+ // Quote the executable if it contains spaces and is not already quoted
31
+ if (executable.includes(' ') && !(executable.startsWith('"') && executable.endsWith('"'))) {
32
+ executable = `"${executable}"`;
33
+ }
34
const args = environment.execInfo?.activatedRun?.args ?? environment.execInfo?.run.args ?? [];
35
const allArgs = [...args, ...options.args];
36
0 commit comments