scroll_terminal_by_line (#10353)

Co-authored-by: gh-log <>
This commit is contained in:
gh-log 2025-03-11 23:48:34 +00:00 committed by GitHub
parent 5deb725758
commit 424b062d5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 34 additions and 8 deletions

View File

@ -309,10 +309,16 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
case 'scroll-to-top':
this.frontend?.scrollToTop()
break
case 'scroll-up':
case 'scroll-page-up':
this.frontend?.scrollPages(-1)
break
case 'scroll-up':
this.frontend?.scrollLines(-1)
break
case 'scroll-down':
this.frontend?.scrollLines(1)
break
case 'scroll-page-down':
this.frontend?.scrollPages(1)
break
case 'scroll-to-bottom':

View File

@ -101,8 +101,10 @@ export class TerminalConfigProvider extends ConfigProvider {
'⌘-⌥-Shift-I',
],
'scroll-to-top': ['Shift-PageUp'],
'scroll-up': ['⌥-PageUp'],
'scroll-down': ['⌥-PageDown'],
'scroll-page-up': ['⌥-PageUp'],
'scroll-up': ['Ctrl-Shift-Up'],
'scroll-down': ['Ctrl-Shift-Down'],
'scroll-page-down': ['⌥-PageDown'],
'scroll-to-bottom': ['Shift-PageDown'],
},
},
@ -152,8 +154,10 @@ export class TerminalConfigProvider extends ConfigProvider {
'Ctrl-Alt-Shift-I',
],
'scroll-to-top': ['Ctrl-PageUp'],
'scroll-up': ['Alt-PageUp'],
'scroll-down': ['Alt-PageDown'],
'scroll-page-up': ['Alt-PageUp'],
'scroll-up': ['Ctrl-Shift-Up'],
'scroll-down': ['Ctrl-Shift-Down'],
'scroll-page-down': ['Alt-PageDown'],
'scroll-to-bottom': ['Ctrl-PageDown'],
},
},
@ -201,8 +205,10 @@ export class TerminalConfigProvider extends ConfigProvider {
'Ctrl-Alt-Shift-I',
],
'scroll-to-top': ['Ctrl-PageUp'],
'scroll-up': ['Alt-PageUp'],
'scroll-down': ['Alt-PageDown'],
'scroll-page-up': ['Alt-PageUp'],
'scroll-up': ['Ctrl-Shift-Up'],
'scroll-down': ['Ctrl-Shift-Down'],
'scroll-page-down': ['Alt-PageDown'],
'scroll-to-bottom': ['Ctrl-PageDown'],
},
},

View File

@ -77,6 +77,7 @@ export abstract class Frontend {
abstract visualBell (): void
abstract scrollToTop (): void
abstract scrollLines (amount: number): void
abstract scrollPages (pages: number): void
abstract scrollToBottom (): void

View File

@ -357,6 +357,10 @@ export class XTermFrontend extends Frontend {
this.xterm.scrollPages(pages)
}
scrollLines (amount: number): void {
this.xterm.scrollLines(amount)
}
scrollToBottom (): void {
this.xtermCore._scrollToBottom()
}

View File

@ -86,11 +86,19 @@ export class TerminalHotkeyProvider extends HotkeyProvider {
name: this.translate.instant('Scroll terminal to top'),
},
{
id: 'scroll-up',
id: 'scroll-page-up',
name: this.translate.instant('Scroll terminal one page up'),
},
{
id: 'scroll-up',
name: this.translate.instant('Scroll terminal one line up'),
},
{
id: 'scroll-down',
name: this.translate.instant('Scroll terminal one line down'),
},
{
id: 'scroll-page-down',
name: this.translate.instant('Scroll terminal one page down'),
},
{
@ -113,3 +121,4 @@ export class TerminalHotkeyProvider extends HotkeyProvider {
return this.hotkeys
}
}