Skip to content

Commit a8df773

Browse files
authoredMar 10, 2022
Merge pull request #5101 from OmniSharp/quote-path
Quote launch paths when necessary
2 parents 090acf0 + 621c989 commit a8df773

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/omnisharp/launcher.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ async function launchDotnet(launchInfo: LaunchInfo, cwd: string, args: string[],
350350
}
351351
else {
352352
command = platformInfo.isWindows() ? 'dotnet.exe' : 'dotnet';
353-
argsCopy.unshift(launchInfo.DotnetLaunchPath ?? launchInfo.LaunchPath);
353+
argsCopy.unshift(`"${launchInfo.DotnetLaunchPath ?? launchInfo.LaunchPath}"`);
354354
}
355355

356356
const process = spawn(command, argsCopy, { detached: false, cwd, env: dotnetInfo.env });
@@ -373,7 +373,7 @@ function launchWindows(launchPath: string, cwd: string, args: string[]): LaunchR
373373
}
374374

375375
let argsCopy = args.slice(0); // create copy of args
376-
argsCopy.unshift(launchPath);
376+
argsCopy.unshift(`"${launchPath}"`);
377377
argsCopy = [[
378378
'/s',
379379
'/c',
@@ -408,7 +408,7 @@ function launchNix(launchPath: string, cwd: string, args: string[]): LaunchResul
408408

409409
function launchNixMono(launchPath: string, cwd: string, args: string[], environment: NodeJS.ProcessEnv, useDebugger: boolean): LaunchResult {
410410
let argsCopy = args.slice(0); // create copy of details args
411-
argsCopy.unshift(launchPath);
411+
argsCopy.unshift(`$"{launchPath}"`);
412412
argsCopy.unshift("--assembly-loader=strict");
413413

414414
if (useDebugger) {

0 commit comments

Comments
 (0)
Please sign in to comment.