mirror of
https://github.com/Eugeny/tabby
synced 2024-11-14 17:07:15 +00:00
fixed #194 - added hotkeys to scroll the terminal
This commit is contained in:
parent
5d383eea04
commit
c43137b8f6
5 changed files with 44 additions and 1 deletions
|
@ -279,6 +279,15 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
|||
case 'copy-current-path':
|
||||
this.copyCurrentPath()
|
||||
break
|
||||
case 'scroll-to-top':
|
||||
this.frontend?.scrollToTop()
|
||||
break
|
||||
case 'scroll-up':
|
||||
this.frontend?.scrollPages(-1)
|
||||
break
|
||||
case 'scroll-down':
|
||||
this.frontend?.scrollPages(1)
|
||||
break
|
||||
case 'scroll-to-bottom':
|
||||
this.frontend?.scrollToBottom()
|
||||
break
|
||||
|
|
|
@ -5,7 +5,6 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||
defaults = {
|
||||
hotkeys: {
|
||||
'copy-current-path': [],
|
||||
'scroll-to-bottom': [],
|
||||
},
|
||||
terminal: {
|
||||
frontend: 'xterm',
|
||||
|
@ -113,6 +112,10 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||
'pane-focus-all': [
|
||||
'⌘-Shift-I',
|
||||
],
|
||||
'scroll-to-top': ['Shift-PageUp'],
|
||||
'scroll-up': ['PageUp'],
|
||||
'scroll-down': ['PageDown'],
|
||||
'scroll-to-bottom': ['Shift-PageDown'],
|
||||
},
|
||||
},
|
||||
[Platform.Windows]: {
|
||||
|
@ -157,6 +160,10 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||
'pane-focus-all': [
|
||||
'Ctrl-Shift-I',
|
||||
],
|
||||
'scroll-to-top': ['Ctrl-PageUp'],
|
||||
'scroll-up': ['PageUp'],
|
||||
'scroll-down': ['PageDown'],
|
||||
'scroll-to-bottom': ['Ctrl-PageDown'],
|
||||
},
|
||||
},
|
||||
[Platform.Linux]: {
|
||||
|
@ -199,6 +206,10 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||
'pane-focus-all': [
|
||||
'Ctrl-Shift-I',
|
||||
],
|
||||
'scroll-to-top': ['Ctrl-PageUp'],
|
||||
'scroll-up': ['PageUp'],
|
||||
'scroll-down': ['PageDown'],
|
||||
'scroll-to-bottom': ['Ctrl-PageDown'],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -75,6 +75,9 @@ export abstract class Frontend {
|
|||
abstract write (data: string): Promise<void>
|
||||
abstract clear (): void
|
||||
abstract visualBell (): void
|
||||
|
||||
abstract scrollToTop (): void
|
||||
abstract scrollPages (pages: number): void
|
||||
abstract scrollToBottom (): void
|
||||
|
||||
abstract configure (): void
|
||||
|
|
|
@ -328,6 +328,14 @@ export class XTermFrontend extends Frontend {
|
|||
}
|
||||
}
|
||||
|
||||
scrollToTop (): void {
|
||||
this.xterm.scrollToTop()
|
||||
}
|
||||
|
||||
scrollPages (pages: number): void {
|
||||
this.xterm.scrollPages(pages)
|
||||
}
|
||||
|
||||
scrollToBottom (): void {
|
||||
this.xtermCore._scrollToBottom()
|
||||
}
|
||||
|
|
|
@ -73,6 +73,18 @@ export class TerminalHotkeyProvider extends HotkeyProvider {
|
|||
id: 'pane-focus-all',
|
||||
name: this.translate.instant('Focus all panes at once (broadcast)'),
|
||||
},
|
||||
{
|
||||
id: 'scroll-to-top',
|
||||
name: this.translate.instant('Scroll terminal to top'),
|
||||
},
|
||||
{
|
||||
id: 'scroll-up',
|
||||
name: this.translate.instant('Scroll terminal one page up'),
|
||||
},
|
||||
{
|
||||
id: 'scroll-down',
|
||||
name: this.translate.instant('Scroll terminal one page down'),
|
||||
},
|
||||
{
|
||||
id: 'scroll-to-bottom',
|
||||
name: this.translate.instant('Scroll terminal to bottom'),
|
||||
|
|
Loading…
Reference in a new issue