Skip to content

Commit

Permalink
feat: reconnect current tab hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
Clem-Fern committed Apr 11, 2023
1 parent d1b4581 commit bbca7a6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions tabby-core/src/configDefaults.linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ hotkeys:
- 'Ctrl-Shift'
duplicate-tab: []
restart-tab: []
reconnect-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: []
duplicate-tab: []
restart-tab: []
reconnect-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 @@ -23,6 +23,7 @@ hotkeys:
- 'Ctrl-Shift'
duplicate-tab: []
restart-tab: []
reconnect-tab: []
explode-tab:
- 'Ctrl-Shift-.'
combine-tabs:
Expand Down
7 changes: 6 additions & 1 deletion tabby-terminal/src/api/baseTerminalTab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -306,6 +306,11 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
case 'scroll-to-bottom':
this.frontend?.scrollToBottom()
break
case 'reconnect-tab':
if (isReconnectable(this)) {
this.reconnect()
}
break
}
})

Expand Down
4 changes: 4 additions & 0 deletions tabby-terminal/src/hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
Expand Down

0 comments on commit bbca7a6

Please sign in to comment.