Skip to content

Commit 4d42d88

Browse files
include current runspace and runspace 1 if should (PowerShell#1800)
* include current runspace and runspace 1 if should * to => in * more explicit
1 parent 87e05d7 commit 4d42d88

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/features/DebugSession.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,12 @@ export class PickPSHostProcessFeature implements IFeature {
358358

359359
private pickPSHostProcess(): Thenable<string> {
360360
return this.languageClient.sendRequest(GetPSHostProcessesRequestType, null).then((hostProcesses) => {
361-
const items: IProcessItem[] = [];
361+
// Start with the current PowerShell process in the list.
362+
const items: IProcessItem[] = [{
363+
label: "Current",
364+
description: "The current PowerShell Integrated Console process.",
365+
pid: "current",
366+
}];
362367

363368
for (const p in hostProcesses) {
364369
if (hostProcesses.hasOwnProperty(p)) {
@@ -487,7 +492,8 @@ export class PickRunspaceFeature implements IFeature {
487492

488493
for (const runspace of response) {
489494
// Skip default runspace
490-
if (runspace.id === 1 || runspace.name === "PSAttachRunspace") {
495+
if ((runspace.id === 1 || runspace.name === "PSAttachRunspace")
496+
&& processId === "current") {
491497
continue;
492498
}
493499

0 commit comments

Comments
 (0)