From bbca7a6a84ba8f06d367dbc976fe7386f8757d77 Mon Sep 17 00:00:00 2001 From: Clem Date: Tue, 11 Apr 2023 23:47:24 +0200 Subject: [PATCH] feat: reconnect current tab hotkey --- tabby-core/src/configDefaults.linux.yaml | 1 + tabby-core/src/configDefaults.macos.yaml | 1 + tabby-core/src/configDefaults.windows.yaml | 1 + tabby-terminal/src/api/baseTerminalTab.component.ts | 7 ++++++- tabby-terminal/src/hotkeys.ts | 4 ++++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tabby-core/src/configDefaults.linux.yaml b/tabby-core/src/configDefaults.linux.yaml index 11a2fed1..1d213e10 100644 --- a/tabby-core/src/configDefaults.linux.yaml +++ b/tabby-core/src/configDefaults.linux.yaml @@ -22,6 +22,7 @@ hotkeys: - 'Ctrl-Shift' duplicate-tab: [] restart-tab: [] + reconnect-tab: [] explode-tab: - 'Ctrl-Shift-.' combine-tabs: diff --git a/tabby-core/src/configDefaults.macos.yaml b/tabby-core/src/configDefaults.macos.yaml index 7228a242..d47050c4 100644 --- a/tabby-core/src/configDefaults.macos.yaml +++ b/tabby-core/src/configDefaults.macos.yaml @@ -39,6 +39,7 @@ hotkeys: tab-10: [] duplicate-tab: [] restart-tab: [] + reconnect-tab: [] explode-tab: - '⌘-Shift-.' combine-tabs: diff --git a/tabby-core/src/configDefaults.windows.yaml b/tabby-core/src/configDefaults.windows.yaml index 340f93d7..58870f8e 100644 --- a/tabby-core/src/configDefaults.windows.yaml +++ b/tabby-core/src/configDefaults.windows.yaml @@ -23,6 +23,7 @@ hotkeys: - 'Ctrl-Shift' duplicate-tab: [] restart-tab: [] + reconnect-tab: [] explode-tab: - 'Ctrl-Shift-.' combine-tabs: diff --git a/tabby-terminal/src/api/baseTerminalTab.component.ts b/tabby-terminal/src/api/baseTerminalTab.component.ts index a23f1f07..f781afd6 100644 --- a/tabby-terminal/src/api/baseTerminalTab.component.ts +++ b/tabby-terminal/src/api/baseTerminalTab.component.ts @@ -9,7 +9,7 @@ import { BaseSession } from '../session' import { Frontend } from '../frontends/frontend' import { XTermFrontend, XTermWebGLFrontend } from '../frontends/xtermFrontend' -import { ResizeEvent, BaseTerminalProfile } from './interfaces' +import { ResizeEvent, BaseTerminalProfile, isReconnectable } from './interfaces' import { TerminalDecorator } from './decorator' import { SearchPanelComponent } from '../components/searchPanel.component' import { MultifocusService } from '../services/multifocus.service' @@ -306,6 +306,11 @@ export class BaseTerminalTabComponent

extends Bas case 'scroll-to-bottom': this.frontend?.scrollToBottom() break + case 'reconnect-tab': + if (isReconnectable(this)) { + this.reconnect() + } + break } }) diff --git a/tabby-terminal/src/hotkeys.ts b/tabby-terminal/src/hotkeys.ts index 808c17ef..08c69798 100644 --- a/tabby-terminal/src/hotkeys.ts +++ b/tabby-terminal/src/hotkeys.ts @@ -97,6 +97,10 @@ export class TerminalHotkeyProvider extends HotkeyProvider { id: 'scroll-to-bottom', name: this.translate.instant('Scroll terminal to bottom'), }, + { + id: 'reconnect-tab', + name: this.translate.instant('Reconnect current tab (Serial/Telnet/SSH)'), + }, ] constructor (private translate: TranslateService) { super() }