diff --git a/tabby-terminal/src/api/connectableTerminalTab.component.ts b/tabby-terminal/src/api/connectableTerminalTab.component.ts index ca2e6ba20a..e54451ddf0 100644 --- a/tabby-terminal/src/api/connectableTerminalTab.component.ts +++ b/tabby-terminal/src/api/connectableTerminalTab.component.ts @@ -16,6 +16,7 @@ import { GetRecoveryTokenOptions, RecoveryToken } from 'tabby-core' export abstract class ConnectableTerminalTabComponent

extends BaseTerminalTabComponent

{ protected reconnectOffered = false + protected isDisconnectedByHand = false constructor (protected injector: Injector) { super(injector) @@ -44,6 +45,7 @@ export abstract class ConnectableTerminalTabComponent

{ this.reconnectOffered = false + this.isDisconnectedByHand = false } /** @@ -53,7 +55,7 @@ export abstract class ConnectableTerminalTabComponent

{ return { type: `app:${this.profile.type}-tab`, @@ -85,6 +97,11 @@ export abstract class ConnectableTerminalTabComponent

{ + this.isDisconnectedByHand = true + await this.session?.destroy() + } + async reconnect (): Promise { this.session?.destroy() await this.initializeSession() diff --git a/tabby-terminal/src/tabContextMenu.ts b/tabby-terminal/src/tabContextMenu.ts index 5d48502218..9be7947618 100644 --- a/tabby-terminal/src/tabContextMenu.ts +++ b/tabby-terminal/src/tabContextMenu.ts @@ -99,6 +99,15 @@ export class ReconnectContextMenu extends TabContextMenuItemProvider { async getItems (tab: BaseTabComponent): Promise { if (tab instanceof ConnectableTerminalTabComponent) { return [ + { + label: this.translate.instant('Disconnect'), + click: (): void => { + setTimeout(() => { + tab.disconnect() + this.notifications.notice(this.translate.instant('Disconnect')) + }) + }, + }, { label: this.translate.instant('Reconnect'), click: (): void => {