Merge from vscode 2f984aad710215f4e4684a035bb02f55d1a9e2cc (#9819)

This commit is contained in:
Anthony Dresser
2020-04-01 00:44:39 -07:00
committed by GitHub
parent 0e27aaa61f
commit 0bfbdc62ed
247 changed files with 5402 additions and 3311 deletions

View File

@@ -178,19 +178,14 @@ export class TerminalService implements ITerminalService {
this._extHostsReady[remoteAuthority] = { promise, resolve };
}
private async _onBeforeShutdown(): Promise<boolean> {
private _onBeforeShutdown(): boolean | Promise<boolean> {
if (this.terminalInstances.length === 0) {
// No terminal instances, don't veto
return false;
}
if (this.configHelper.config.confirmOnExit) {
// veto if configured to show confirmation and the user choosed not to exit
const veto = await this._showTerminalCloseConfirmation();
if (!veto) {
this._isShuttingDown = true;
}
return veto;
return this._onBeforeShutdownAsync();
}
this._isShuttingDown = true;
@@ -198,6 +193,15 @@ export class TerminalService implements ITerminalService {
return false;
}
private async _onBeforeShutdownAsync(): Promise<boolean> {
// veto if configured to show confirmation and the user choosed not to exit
const veto = await this._showTerminalCloseConfirmation();
if (!veto) {
this._isShuttingDown = true;
}
return veto;
}
private _onShutdown(): void {
// Dispose of all instances
this.terminalInstances.forEach(instance => instance.dispose(true));