warn when closing ssh tabs - fixes #2512

上级 328490a8
......@@ -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()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册