Skip to content

Commit 271c260

Browse files
authored
Fix terminal process leak when closing the window. (#2723)
1 parent 7e399b9 commit 271c260

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/vscode/src/vs/server/node/channel.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -575,17 +575,17 @@ class Terminal {
575575
// type: 'orphan?';
576576
}
577577

578-
public dispose() {
578+
public async dispose() {
579579
logger.debug('Terminal disposing', field('id', this.id));
580580
this._onEvent.dispose();
581581
this.bufferer.dispose();
582+
await this.process.shutdown(true);
582583
this.process.dispose();
583-
this.process.shutdown(true);
584584
this._onDispose.fire();
585585
this._onDispose.dispose();
586586
}
587587

588-
public shutdown(immediate: boolean): void {
588+
public shutdown(immediate: boolean): Promise<void> {
589589
return this.process.shutdown(immediate);
590590
}
591591

lib/vscode/src/vs/workbench/contrib/terminal/node/terminalProcess.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,9 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
245245
this._onProcessTitleChanged.fire(this._currentTitle);
246246
}
247247

248-
public shutdown(immediate: boolean): void {
248+
public async shutdown(immediate: boolean): Promise<void> {
249249
if (immediate) {
250-
this._kill();
250+
await this._kill();
251251
} else {
252252
this._queueProcessExit();
253253
}

0 commit comments

Comments
 (0)