warn when closing ssh tabs - fixes #2512

This commit is contained in:
Eugene Pankov 2020-05-26 17:12:48 +02:00
parent 328490a85e
commit 95bd48d6c6
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -153,6 +153,18 @@ export class SSHTabComponent extends BaseTerminalTabComponent {
this.initializeSession()
}
async canClose (): Promise<boolean> {
return (await this.electron.showMessageBox(
this.hostApp.getWindow(),
{
type: 'warning',
message: `Disconnect from ${this.connection.host}?`,
buttons: ['Cancel', 'Disconnect'],
defaultId: 1,
}
)).response === 1
}
ngOnDestroy (): void {
this.homeEndSubscription.unsubscribe()
super.ngOnDestroy()