mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 01:00:29 -04:00
Merge from vscode 2f984aad710215f4e4684a035bb02f55d1a9e2cc (#9819)
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user