Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote launch paths when necessary #5101

Merged
merged 1 commit into from
Mar 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/omnisharp/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ async function launchDotnet(launchInfo: LaunchInfo, cwd: string, args: string[],
}
else {
command = platformInfo.isWindows() ? 'dotnet.exe' : 'dotnet';
argsCopy.unshift(launchInfo.DotnetLaunchPath ?? launchInfo.LaunchPath);
argsCopy.unshift(`"${launchInfo.DotnetLaunchPath ?? launchInfo.LaunchPath}"`);
}

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

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

function launchNixMono(launchPath: string, cwd: string, args: string[], environment: NodeJS.ProcessEnv, useDebugger: boolean): LaunchResult {
let argsCopy = args.slice(0); // create copy of details args
argsCopy.unshift(launchPath);
argsCopy.unshift(`$"{launchPath}"`);
Copy link

@vchirikov vchirikov Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a typo

Suggested change
argsCopy.unshift(`$"{launchPath}"`);
argsCopy.unshift(`"${launchPath}"`);

@333fred check this pls

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vchirikov no need to ping me so many times, I'm watching this issue :).

Yes, that does indeed look suspicious. However, this is launching mono on Linux or Unix, not anything to do with Windows.

argsCopy.unshift("--assembly-loader=strict");

if (useDebugger) {
Expand Down