Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c08d7a2

Browse files
rkeithhilldaviwil
authored andcommittedOct 26, 2017
Attach to process does work on PS Core on windows
Well actually we have some issues (step buttons are not enable) but you can drive it from PSIC. Fix typo in method name - man I'm going to have to up the font size on my hi-DPI laptop. Getting old man eyes.
1 parent 0def853 commit c08d7a2

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
 

‎src/features/DebugSession.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import Settings = require('../settings');
88
import { dirname } from 'path';
99
import { IFeature } from '../feature';
1010
import { SessionManager } from '../session';
11+
import { OperatingSystem, PlatformDetails, getPlatformDetails } from '../platform';
12+
1113
import { LanguageClient, RequestType, NotificationType } from 'vscode-languageclient';
1214
import { CancellationToken, DebugConfiguration, DebugConfigurationProvider,
1315
ExtensionContext, ProviderResult, WorkspaceFolder } from 'vscode';
@@ -44,8 +46,12 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
4446
let createNewIntegratedConsole = settings.debugging.createTemporaryIntegratedConsole;
4547

4648
if (config.request === "attach") {
47-
let versionDetails = this.sessionManager.getPowerShellVersionDetais();
48-
if (versionDetails.edition.toLowerCase() === "core") {
49+
let platformDetails = getPlatformDetails();
50+
let versionDetails = this.sessionManager.getPowerShellVersionDetails();
51+
52+
if (versionDetails.edition.toLowerCase() === "core" &&
53+
platformDetails.operatingSystem !== OperatingSystem.Windows) {
54+
4955
let msg = "PowerShell Core does not support attaching to a PowerShell host process.";
5056
return vscode.window.showErrorMessage(msg).then(_ => {
5157
return undefined;

‎src/session.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export class SessionManager implements Middleware {
217217
return this.sessionDetails;
218218
}
219219

220-
public getPowerShellVersionDetais() : PowerShellVersionDetails {
220+
public getPowerShellVersionDetails() : PowerShellVersionDetails {
221221
return this.versionDetails;
222222
}
223223

0 commit comments

Comments
 (0)
Please sign in to comment.