Skip to content

Commit 5438c9b

Browse files
committed
Have terminals fire onExit when killed by user
Fixes microsoft#78804
1 parent f2a3652 commit 5438c9b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/vs/workbench/contrib/terminal/browser/terminalInstance.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,9 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
814814
}
815815

816816
this._processManager.dispose(immediate);
817+
// Process manager dispose/shutdown doesn't fire process exit, trigger with undefined if it
818+
// hasn't happened yet
819+
this._onProcessExit(undefined);
817820

818821
if (!this._isDisposed) {
819822
this._isDisposed = true;
@@ -1012,13 +1015,13 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
10121015
* through user action.
10131016
*/
10141017
private _onProcessExit(exitCode?: number): void {
1015-
this._logService.debug(`Terminal process exit (id: ${this.id}) with code ${exitCode}`);
1016-
10171018
// Prevent dispose functions being triggered multiple times
10181019
if (this._isExiting) {
10191020
return;
10201021
}
10211022

1023+
this._logService.debug(`Terminal process exit (id: ${this.id}) with code ${exitCode}`);
1024+
10221025
this._isExiting = true;
10231026
let exitCodeMessage: string | undefined;
10241027

0 commit comments

Comments
 (0)