mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-09 06:20:22 +08:00
warn when closing ssh tabs - fixes #2512
This commit is contained in:
parent
328490a85e
commit
95bd48d6c6
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user