mirror of
https://github.com/Eugeny/tabby.git
synced 2024-11-28 05:36:31 +03:00
make scroll-on-input behaviour configurable (fixes #543)
This commit is contained in:
parent
c58c629d0e
commit
f32bdbdeac
@ -83,6 +83,15 @@ h3.mb-3 Terminal
|
||||
(ngModelChange)='config.save()',
|
||||
)
|
||||
|
||||
.form-line
|
||||
.header
|
||||
.title Scroll on input
|
||||
.description Scrolls the terminal to the bottom on user input
|
||||
toggle(
|
||||
[(ngModel)]='config.store.terminal.scrollOnInput',
|
||||
(ngModelChange)='config.save()',
|
||||
)
|
||||
|
||||
.form-line
|
||||
.header
|
||||
.title Use Alt key as the Meta key
|
||||
|
@ -264,9 +264,9 @@ export class TerminalTabComponent extends BaseTabComponent {
|
||||
let wheelDeltaY = 0
|
||||
|
||||
if ('wheelDeltaY' in event) {
|
||||
wheelDeltaY = (event as MouseWheelEvent)["wheelDeltaY"]
|
||||
wheelDeltaY = (event as MouseWheelEvent).wheelDeltaY
|
||||
} else {
|
||||
wheelDeltaY = (event as MouseWheelEvent)["deltaY"]
|
||||
wheelDeltaY = (event as MouseWheelEvent).deltaY
|
||||
}
|
||||
if (event.ctrlKey || event.metaKey) {
|
||||
|
||||
@ -300,8 +300,10 @@ export class TerminalTabComponent extends BaseTabComponent {
|
||||
|
||||
sendInput (data: string) {
|
||||
this.session.write(data)
|
||||
if (this.config.store.terminal.scrollOnInput) {
|
||||
this.frontend.scrollToBottom()
|
||||
}
|
||||
}
|
||||
|
||||
write (data: string) {
|
||||
let percentageMatch = /(^|[^\d])(\d+(\.\d+)?)%([^\d]|$)/.exec(data)
|
||||
|
@ -21,6 +21,7 @@ export class TerminalConfigProvider extends ConfigProvider {
|
||||
customShell: '',
|
||||
rightClick: 'menu',
|
||||
copyOnSelect: false,
|
||||
scrollOnInput: true,
|
||||
workingDirectory: '',
|
||||
altIsMeta: false,
|
||||
colorScheme: {
|
||||
|
@ -72,6 +72,8 @@ export class HTermFrontend extends Frontend {
|
||||
preferenceManager.set('pass-alt-number', true)
|
||||
preferenceManager.set('cursor-blink', config.terminal.cursorBlink)
|
||||
preferenceManager.set('clear-selection-after-copy', true)
|
||||
preferenceManager.set('scroll-on-output', false)
|
||||
preferenceManager.set('scroll-on-keystroke', config.terminal.scrollOnInput)
|
||||
|
||||
if (config.terminal.colorScheme.foreground) {
|
||||
preferenceManager.set('foreground-color', config.terminal.colorScheme.foreground)
|
||||
|
Loading…
Reference in New Issue
Block a user