Only dispose TerminalInstance.onExit when it's already disposed
Fixes #130277
This commit is contained in:
parent
227601428b
commit
2e23a7c3ad
1 changed files with 6 additions and 1 deletions
|
@ -1332,8 +1332,13 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
|||
}
|
||||
}
|
||||
|
||||
// First onExit to consumers, this can happen after the terminal has already been disposed.
|
||||
this._onExit.fire(this._exitCode);
|
||||
this._onExit.dispose();
|
||||
|
||||
// Dispose of the onExit event if the terminal will not be reused again
|
||||
if (this._isDisposed) {
|
||||
this._onExit.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue