mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-24 02:53:43 +03:00
xterm: passthrough arrows with modifiers when in alternate mode - fixes #2328
This commit is contained in:
parent
030ddc721d
commit
d1ac265d79
@ -82,4 +82,5 @@ export abstract class Frontend {
|
||||
abstract restoreState (state: string): void
|
||||
|
||||
abstract supportsBracketedPaste (): boolean
|
||||
abstract isAlternateScreenActive (): boolean
|
||||
}
|
||||
|
@ -86,6 +86,16 @@ export class XTermFrontend extends Frontend {
|
||||
this.xterm.unicode.activeVersion = '11'
|
||||
|
||||
const keyboardEventHandler = (name: string, event: KeyboardEvent) => {
|
||||
if (this.isAlternateScreenActive()) {
|
||||
let modifiers = 0
|
||||
modifiers += event.ctrlKey ? 1 : 0
|
||||
modifiers += event.altKey ? 1 : 0
|
||||
modifiers += event.shiftKey ? 1 : 0
|
||||
modifiers += event.metaKey ? 1 : 0
|
||||
if (event.key.startsWith('Arrow') && modifiers === 1) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
this.hotkeysService.pushKeyEvent(name, event)
|
||||
let ret = true
|
||||
if (this.hotkeysService.matchActiveHotkey(true) !== null) {
|
||||
@ -331,6 +341,10 @@ export class XTermFrontend extends Frontend {
|
||||
return this.xterm.modes.bracketedPasteMode
|
||||
}
|
||||
|
||||
isAlternateScreenActive (): boolean {
|
||||
return this.xterm.buffer.active.type === 'alternate'
|
||||
}
|
||||
|
||||
private setFontSize () {
|
||||
const scale = Math.pow(1.1, this.zoom)
|
||||
this.xterm.options.fontSize = this.configuredFontSize * scale
|
||||
|
Loading…
Reference in New Issue
Block a user