@@ -10,6 +10,7 @@ import { CancellationToken, DebugConfiguration, DebugConfigurationProvider,
1010import { LanguageClient , NotificationType , RequestType } from "vscode-languageclient" ;
1111import { IFeature } from "../feature" ;
1212import { getPlatformDetails , IPlatformDetails , OperatingSystem } from "../platform" ;
13+ import { PowerShellProcess } from "../process" ;
1314import { SessionManager } from "../session" ;
1415import Settings = require( "../settings" ) ;
1516import 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