Skip to content

Commit 4f08542

Browse files
authored
Persist temp console debug session (#1201)
Requires PR on PSES.
1 parent 5ad413c commit 4f08542

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
@@ -10,6 +10,7 @@ import { CancellationToken, DebugConfiguration, DebugConfigurationProvider,
1010
import { LanguageClient, NotificationType, RequestType } from "vscode-languageclient";
1111
import { IFeature } from "../feature";
1212
import { getPlatformDetails, IPlatformDetails, OperatingSystem } from "../platform";
13+
import { PowerShellProcess} from "../process";
1314
import { SessionManager } from "../session";
1415
import Settings = require("../settings");
1516
import utils = require("../utils");
@@ -19,6 +20,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
1920
private sessionCount: number = 1;
2021
private command: vscode.Disposable;
2122
private examplesPath: string;
23+
private tempDebugProcess: PowerShellProcess;
2224

2325
constructor(context: ExtensionContext, private sessionManager: SessionManager) {
2426
// Register a debug configuration provider
@@ -145,12 +147,16 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
145147
const sessionFilePath = utils.getDebugSessionFilePath();
146148

147149
if (createNewIntegratedConsole) {
148-
const debugProcess =
150+
if (this.tempDebugProcess) {
151+
this.tempDebugProcess.dispose();
152+
}
153+
154+
this.tempDebugProcess =
149155
this.sessionManager.createDebugSessionProcess(
150156
sessionFilePath,
151157
settings);
152158

153-
debugProcess
159+
this.tempDebugProcess
154160
.start(`DebugSession-${this.sessionCount++}`)
155161
.then((sessionDetails) => {
156162
utils.writeSessionFile(sessionFilePath, sessionDetails);

0 commit comments

Comments
 (0)