Skip to content

Commit 424b062

Browse files
authored
scroll_terminal_by_line (#10353)
Co-authored-by: gh-log <>
1 parent 5deb725 commit 424b062

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

tabby-terminal/src/api/baseTerminalTab.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,16 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> extends Bas
309309
case 'scroll-to-top':
310310
this.frontend?.scrollToTop()
311311
break
312-
case 'scroll-up':
312+
case 'scroll-page-up':
313313
this.frontend?.scrollPages(-1)
314314
break
315+
case 'scroll-up':
316+
this.frontend?.scrollLines(-1)
317+
break
315318
case 'scroll-down':
319+
this.frontend?.scrollLines(1)
320+
break
321+
case 'scroll-page-down':
316322
this.frontend?.scrollPages(1)
317323
break
318324
case 'scroll-to-bottom':

tabby-terminal/src/config.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ export class TerminalConfigProvider extends ConfigProvider {
101101
'⌘-⌥-Shift-I',
102102
],
103103
'scroll-to-top': ['Shift-PageUp'],
104-
'scroll-up': ['⌥-PageUp'],
105-
'scroll-down': ['⌥-PageDown'],
104+
'scroll-page-up': ['⌥-PageUp'],
105+
'scroll-up': ['Ctrl-Shift-Up'],
106+
'scroll-down': ['Ctrl-Shift-Down'],
107+
'scroll-page-down': ['⌥-PageDown'],
106108
'scroll-to-bottom': ['Shift-PageDown'],
107109
},
108110
},
@@ -152,8 +154,10 @@ export class TerminalConfigProvider extends ConfigProvider {
152154
'Ctrl-Alt-Shift-I',
153155
],
154156
'scroll-to-top': ['Ctrl-PageUp'],
155-
'scroll-up': ['Alt-PageUp'],
156-
'scroll-down': ['Alt-PageDown'],
157+
'scroll-page-up': ['Alt-PageUp'],
158+
'scroll-up': ['Ctrl-Shift-Up'],
159+
'scroll-down': ['Ctrl-Shift-Down'],
160+
'scroll-page-down': ['Alt-PageDown'],
157161
'scroll-to-bottom': ['Ctrl-PageDown'],
158162
},
159163
},
@@ -201,8 +205,10 @@ export class TerminalConfigProvider extends ConfigProvider {
201205
'Ctrl-Alt-Shift-I',
202206
],
203207
'scroll-to-top': ['Ctrl-PageUp'],
204-
'scroll-up': ['Alt-PageUp'],
205-
'scroll-down': ['Alt-PageDown'],
208+
'scroll-page-up': ['Alt-PageUp'],
209+
'scroll-up': ['Ctrl-Shift-Up'],
210+
'scroll-down': ['Ctrl-Shift-Down'],
211+
'scroll-page-down': ['Alt-PageDown'],
206212
'scroll-to-bottom': ['Ctrl-PageDown'],
207213
},
208214
},

tabby-terminal/src/frontends/frontend.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export abstract class Frontend {
7777
abstract visualBell (): void
7878

7979
abstract scrollToTop (): void
80+
abstract scrollLines (amount: number): void
8081
abstract scrollPages (pages: number): void
8182
abstract scrollToBottom (): void
8283

tabby-terminal/src/frontends/xtermFrontend.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,10 @@ export class XTermFrontend extends Frontend {
357357
this.xterm.scrollPages(pages)
358358
}
359359

360+
scrollLines (amount: number): void {
361+
this.xterm.scrollLines(amount)
362+
}
363+
360364
scrollToBottom (): void {
361365
this.xtermCore._scrollToBottom()
362366
}

tabby-terminal/src/hotkeys.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,19 @@ export class TerminalHotkeyProvider extends HotkeyProvider {
8686
name: this.translate.instant('Scroll terminal to top'),
8787
},
8888
{
89-
id: 'scroll-up',
89+
id: 'scroll-page-up',
9090
name: this.translate.instant('Scroll terminal one page up'),
9191
},
92+
{
93+
id: 'scroll-up',
94+
name: this.translate.instant('Scroll terminal one line up'),
95+
},
9296
{
9397
id: 'scroll-down',
98+
name: this.translate.instant('Scroll terminal one line down'),
99+
},
100+
{
101+
id: 'scroll-page-down',
94102
name: this.translate.instant('Scroll terminal one page down'),
95103
},
96104
{
@@ -113,3 +121,4 @@ export class TerminalHotkeyProvider extends HotkeyProvider {
113121
return this.hotkeys
114122
}
115123
}
124+

0 commit comments

Comments
 (0)