From 95bd48d6c66c3424d4f64ab2aac22480a35487d4 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Tue, 26 May 2020 17:12:48 +0200 Subject: [PATCH] warn when closing ssh tabs - fixes #2512 --- terminus-ssh/src/components/sshTab.component.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/terminus-ssh/src/components/sshTab.component.ts b/terminus-ssh/src/components/sshTab.component.ts index 17a646a0..40b9bc32 100644 --- a/terminus-ssh/src/components/sshTab.component.ts +++ b/terminus-ssh/src/components/sshTab.component.ts @@ -153,6 +153,18 @@ export class SSHTabComponent extends BaseTerminalTabComponent { this.initializeSession() } + async canClose (): Promise { + 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() -- GitLab