Skip to content

Commit

Permalink
support interpreter paths with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorjboyd committed Nov 6, 2024
1 parent b2439ad commit 5955540
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/extension/debugger/adapter/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class DebugAdapterDescriptorFactory implements IDebugAdapterDescriptorFac
sendTelemetryEvent(EventName.DEBUGGER_ATTACH_TO_LOCAL_PROCESS);
}

const executable = command.shift() ?? 'python';
let executable = command.shift() ?? 'python';

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

Expand Down

0 comments on commit 5955540

Please sign in to comment.