diff --git a/tabby-core/src/components/appRoot.component.ts b/tabby-core/src/components/appRoot.component.ts index 5cbccf13..30e338f3 100644 --- a/tabby-core/src/components/appRoot.component.ts +++ b/tabby-core/src/components/appRoot.component.ts @@ -112,6 +112,10 @@ export class AppRootComponent { if (hotkey === 'duplicate-tab') { this.app.duplicateTab(this.app.activeTab) } + if (hotkey === 'restart-tab') { + this.app.duplicateTab(this.app.activeTab) + this.app.closeTab(this.app.activeTab, true) + } if (hotkey === 'explode-tab' && this.app.activeTab instanceof SplitTabComponent) { this.app.explodeTab(this.app.activeTab) } diff --git a/tabby-core/src/configDefaults.linux.yaml b/tabby-core/src/configDefaults.linux.yaml index cadb4160..4805ce0e 100644 --- a/tabby-core/src/configDefaults.linux.yaml +++ b/tabby-core/src/configDefaults.linux.yaml @@ -21,6 +21,7 @@ hotkeys: rearrange-panes: - 'Ctrl-Shift' duplicate-tab: [] + restart-tab: [] explode-tab: - 'Ctrl-Shift-.' combine-tabs: diff --git a/tabby-core/src/configDefaults.macos.yaml b/tabby-core/src/configDefaults.macos.yaml index 620471df..b1be9458 100644 --- a/tabby-core/src/configDefaults.macos.yaml +++ b/tabby-core/src/configDefaults.macos.yaml @@ -39,6 +39,7 @@ hotkeys: tab-10: - '⌘-0' duplicate-tab: [] + restart-tab: [] explode-tab: - '⌘-Shift-.' combine-tabs: diff --git a/tabby-core/src/configDefaults.windows.yaml b/tabby-core/src/configDefaults.windows.yaml index 19293b87..80bd85ee 100644 --- a/tabby-core/src/configDefaults.windows.yaml +++ b/tabby-core/src/configDefaults.windows.yaml @@ -22,6 +22,7 @@ hotkeys: rearrange-panes: - 'Ctrl-Shift' duplicate-tab: [] + restart-tab: [] explode-tab: - 'Ctrl-Shift-.' combine-tabs: diff --git a/tabby-core/src/hotkeys.ts b/tabby-core/src/hotkeys.ts index e35f662f..c6c15403 100644 --- a/tabby-core/src/hotkeys.ts +++ b/tabby-core/src/hotkeys.ts @@ -56,6 +56,10 @@ export class AppHotkeyProvider extends HotkeyProvider { id: 'duplicate-tab', name: this.translate.instant('Duplicate tab'), }, + { + id: 'restart-tab', + name: this.translate.instant('Restart tab'), + }, { id: 'explode-tab', name: this.translate.instant('Turn current tab\'s panes into separate tabs'), diff --git a/tabby-core/src/tabContextMenu.ts b/tabby-core/src/tabContextMenu.ts index 3572239a..d45b65e0 100644 --- a/tabby-core/src/tabContextMenu.ts +++ b/tabby-core/src/tabContextMenu.ts @@ -120,17 +120,6 @@ export class CommonOptionsContextMenu extends TabContextMenuItemProvider { label: this.translate.instant('Duplicate'), click: () => this.app.duplicateTab(tab), }, - { - label: this.translate.instant('Restart'), - click: () => { - this.app.duplicateTab(tab) - if (this.app.tabs.includes(tab)) { - this.app.closeTab(tab, true) - } else { - tab.destroy() - } - }, - }, { label: this.translate.instant('Color'), sublabel: currentColor ? this.translate.instant(currentColor) : undefined,