mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-11 06:59:59 +00:00
feat: add disconnect tab hotkey
This commit is contained in:
parent
b0350b6a35
commit
7f2340e701
@ -23,6 +23,7 @@ hotkeys:
|
|||||||
duplicate-tab: []
|
duplicate-tab: []
|
||||||
restart-tab: []
|
restart-tab: []
|
||||||
reconnect-tab: []
|
reconnect-tab: []
|
||||||
|
disconnect-tab: []
|
||||||
explode-tab:
|
explode-tab:
|
||||||
- 'Ctrl-Shift-.'
|
- 'Ctrl-Shift-.'
|
||||||
combine-tabs:
|
combine-tabs:
|
||||||
|
@ -40,6 +40,7 @@ hotkeys:
|
|||||||
duplicate-tab: []
|
duplicate-tab: []
|
||||||
restart-tab: []
|
restart-tab: []
|
||||||
reconnect-tab: []
|
reconnect-tab: []
|
||||||
|
disconnect-tab: []
|
||||||
explode-tab:
|
explode-tab:
|
||||||
- '⌘-Shift-.'
|
- '⌘-Shift-.'
|
||||||
combine-tabs:
|
combine-tabs:
|
||||||
|
@ -24,6 +24,7 @@ hotkeys:
|
|||||||
duplicate-tab: []
|
duplicate-tab: []
|
||||||
restart-tab: []
|
restart-tab: []
|
||||||
reconnect-tab: []
|
reconnect-tab: []
|
||||||
|
disconnect-tab: []
|
||||||
explode-tab:
|
explode-tab:
|
||||||
- 'Ctrl-Shift-.'
|
- 'Ctrl-Shift-.'
|
||||||
combine-tabs:
|
combine-tabs:
|
||||||
|
@ -22,8 +22,19 @@ export abstract class ConnectableTerminalTabComponent<P extends BaseTerminalProf
|
|||||||
super(injector)
|
super(injector)
|
||||||
|
|
||||||
this.subscribeUntilDestroyed(this.hotkeys.hotkey$, hotkey => {
|
this.subscribeUntilDestroyed(this.hotkeys.hotkey$, hotkey => {
|
||||||
if (this.hasFocus && hotkey === 'reconnect-tab') {
|
if (!this.hasFocus) {
|
||||||
this.reconnect()
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (hotkey) {
|
||||||
|
case 'reconnect-tab':
|
||||||
|
this.reconnect()
|
||||||
|
this.notifications.notice(this.translate.instant('Reconnect'))
|
||||||
|
break
|
||||||
|
case 'disconnect-tab':
|
||||||
|
this.disconnect()
|
||||||
|
this.notifications.notice(this.translate.instant('Disconnect'))
|
||||||
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,10 @@ export class TerminalHotkeyProvider extends HotkeyProvider {
|
|||||||
id: 'reconnect-tab',
|
id: 'reconnect-tab',
|
||||||
name: this.translate.instant('Reconnect current tab (Serial/Telnet/SSH)'),
|
name: this.translate.instant('Reconnect current tab (Serial/Telnet/SSH)'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'disconnect-tab',
|
||||||
|
name: this.translate.instant('Disconnect current tab (Serial/Telnet/SSH)'),
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor (private translate: TranslateService) { super() }
|
constructor (private translate: TranslateService) { super() }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user