Skip to content

Commit 5955540

Browse files
committed
support interpreter paths with spaces
1 parent b2439ad commit 5955540

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/extension/debugger/adapter/factory.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
7676
sendTelemetryEvent(EventName.DEBUGGER_ATTACH_TO_LOCAL_PROCESS);
7777
}
7878

79-
const executable = command.shift() ?? 'python';
79+
let executable = command.shift() ?? 'python';
8080

8181
// "logToFile" is not handled directly by the adapter - instead, we need to pass
8282
// the corresponding CLI switch when spawning it.
@@ -85,6 +85,7 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
8585
if (configuration.debugAdapterPath !== undefined) {
8686
const args = command.concat([configuration.debugAdapterPath, ...logArgs]);
8787
traceLog(`DAP Server launched with command: ${executable} ${args.join(' ')}`);
88+
executable = `"${executable}"`; // surround executable with quotes to handle spaces
8889
return new DebugAdapterExecutable(executable, args);
8990
}
9091

0 commit comments

Comments
 (0)