Skip to content

Commit

Permalink
feat: hotkey-restart-tab, remove restart menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Qiming-Liu authored and Eugeny committed Jul 6, 2022
1 parent aa5970b commit c3abff5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 4 additions & 0 deletions tabby-core/src/components/appRoot.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions tabby-core/src/configDefaults.linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ hotkeys:
rearrange-panes:
- 'Ctrl-Shift'
duplicate-tab: []
restart-tab: []
explode-tab:
- 'Ctrl-Shift-.'
combine-tabs:
Expand Down
1 change: 1 addition & 0 deletions tabby-core/src/configDefaults.macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ hotkeys:
tab-10:
- '⌘-0'
duplicate-tab: []
restart-tab: []
explode-tab:
- '⌘-Shift-.'
combine-tabs:
Expand Down
1 change: 1 addition & 0 deletions tabby-core/src/configDefaults.windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ hotkeys:
rearrange-panes:
- 'Ctrl-Shift'
duplicate-tab: []
restart-tab: []
explode-tab:
- 'Ctrl-Shift-.'
combine-tabs:
Expand Down
4 changes: 4 additions & 0 deletions tabby-core/src/hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
11 changes: 0 additions & 11 deletions tabby-core/src/tabContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c3abff5

Please sign in to comment.