@@ -10,6 +10,7 @@ import { CancellationToken, DebugConfiguration, DebugConfigurationProvider,
10
10
import { LanguageClient , NotificationType , RequestType } from "vscode-languageclient" ;
11
11
import { IFeature } from "../feature" ;
12
12
import { getPlatformDetails , IPlatformDetails , OperatingSystem } from "../platform" ;
13
+ import { PowerShellProcess } from "../process" ;
13
14
import { SessionManager } from "../session" ;
14
15
import Settings = require( "../settings" ) ;
15
16
import utils = require( "../utils" ) ;
@@ -19,6 +20,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
19
20
private sessionCount : number = 1 ;
20
21
private command : vscode . Disposable ;
21
22
private examplesPath : string ;
23
+ private tempDebugProcess : PowerShellProcess ;
22
24
23
25
constructor ( context : ExtensionContext , private sessionManager : SessionManager ) {
24
26
// Register a debug configuration provider
@@ -145,12 +147,16 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
145
147
const sessionFilePath = utils . getDebugSessionFilePath ( ) ;
146
148
147
149
if ( createNewIntegratedConsole ) {
148
- const debugProcess =
150
+ if ( this . tempDebugProcess ) {
151
+ this . tempDebugProcess . dispose ( ) ;
152
+ }
153
+
154
+ this . tempDebugProcess =
149
155
this . sessionManager . createDebugSessionProcess (
150
156
sessionFilePath ,
151
157
settings ) ;
152
158
153
- debugProcess
159
+ this . tempDebugProcess
154
160
. start ( `DebugSession-${ this . sessionCount ++ } ` )
155
161
. then ( ( sessionDetails ) => {
156
162
utils . writeSessionFile ( sessionFilePath , sessionDetails ) ;
0 commit comments