diff --git a/src/features/DebugSession.ts b/src/features/DebugSession.ts index 1c071af8ee..8943ced400 100644 --- a/src/features/DebugSession.ts +++ b/src/features/DebugSession.ts @@ -358,7 +358,12 @@ export class PickPSHostProcessFeature implements IFeature { private pickPSHostProcess(): Thenable { return this.languageClient.sendRequest(GetPSHostProcessesRequestType, null).then((hostProcesses) => { - const items: IProcessItem[] = []; + // Start with the current PowerShell process in the list. + const items: IProcessItem[] = [{ + label: "Current", + description: "The current PowerShell Integrated Console process.", + pid: "current", + }]; for (const p in hostProcesses) { if (hostProcesses.hasOwnProperty(p)) { @@ -487,7 +492,8 @@ export class PickRunspaceFeature implements IFeature { for (const runspace of response) { // Skip default runspace - if (runspace.id === 1 || runspace.name === "PSAttachRunspace") { + if ((runspace.id === 1 || runspace.name === "PSAttachRunspace") + && processId === "current") { continue; }