@@ -74,6 +74,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
74
74
private _ptyResponsiveListener : IDisposable | undefined ;
75
75
private _ptyListenersAttached : boolean = false ;
76
76
private _dataFilter : SeamlessRelaunchDataFilter ;
77
+ private _isFeatureTerminal : boolean = false ;
77
78
78
79
private readonly _onPtyDisconnect = this . _register ( new Emitter < void > ( ) ) ;
79
80
public get onPtyDisconnect ( ) : Event < void > { return this . _onPtyDisconnect . event ; }
@@ -177,6 +178,7 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
177
178
isScreenReaderModeEnabled : boolean ,
178
179
reset : boolean = true
179
180
) : Promise < ITerminalLaunchError | undefined > {
181
+ this . _isFeatureTerminal = ! ! shellLaunchConfig . isFeatureTerminal ;
180
182
if ( shellLaunchConfig . isExtensionCustomPtyTerminal ) {
181
183
this . _processType = ProcessType . ExtensionTerminal ;
182
184
this . _process = this . _instantiationService . createInstance ( TerminalProcessExtHostProxy , this . _instanceId , shellLaunchConfig , cols , rows ) ;
@@ -404,6 +406,13 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
404
406
}
405
407
this . _ptyResponsiveListener ?. dispose ( ) ;
406
408
this . _ptyResponsiveListener = undefined ;
409
+ // Indicate the process is exited (and gone forever) only for feature terminals so they
410
+ // can react to the exit, this is particularly important for tasks so that it knows that
411
+ // the process is not still active. Note that this is not done for regular terminals
412
+ // because otherwise the terminal instance would be disposed
413
+ if ( this . _isFeatureTerminal ) {
414
+ this . _onExit ( undefined ) ;
415
+ }
407
416
} ) ) ;
408
417
}
409
418
0 commit comments