Skip to content

turn off non-windows gate for attach to process #1736

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

Merged
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: 4 additions & 2 deletions src/features/DebugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
const platformDetails = getPlatformDetails();
const versionDetails = this.sessionManager.getPowerShellVersionDetails();

if (platformDetails.operatingSystem !== OperatingSystem.Windows) {
const msg = "Attaching to a PowerShell Host Process is supported only on Windows.";
// Cross-platform attach to process was added in 6.2.0-preview.4
if (versionDetails.version < "6.2.0" && platformDetails.operatingSystem !== OperatingSystem.Windows) {
const msg = `Attaching to a PowerShell Host Process on ${
OperatingSystem[platformDetails.operatingSystem] } requires PowerShell 6.2 or higher.`;
return vscode.window.showErrorMessage(msg).then((_) => {
return undefined;
});
Expand Down