mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-29 07:49:53 +00: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 restoreState (state: string): void
|
||||||
|
|
||||||
abstract supportsBracketedPaste (): boolean
|
abstract supportsBracketedPaste (): boolean
|
||||||
|
abstract isAlternateScreenActive (): boolean
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,16 @@ export class XTermFrontend extends Frontend {
|
|||||||
this.xterm.unicode.activeVersion = '11'
|
this.xterm.unicode.activeVersion = '11'
|
||||||
|
|
||||||
const keyboardEventHandler = (name: string, event: KeyboardEvent) => {
|
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)
|
this.hotkeysService.pushKeyEvent(name, event)
|
||||||
let ret = true
|
let ret = true
|
||||||
if (this.hotkeysService.matchActiveHotkey(true) !== null) {
|
if (this.hotkeysService.matchActiveHotkey(true) !== null) {
|
||||||
@ -331,6 +341,10 @@ export class XTermFrontend extends Frontend {
|
|||||||
return this.xterm.modes.bracketedPasteMode
|
return this.xterm.modes.bracketedPasteMode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isAlternateScreenActive (): boolean {
|
||||||
|
return this.xterm.buffer.active.type === 'alternate'
|
||||||
|
}
|
||||||
|
|
||||||
private setFontSize () {
|
private setFontSize () {
|
||||||
const scale = Math.pow(1.1, this.zoom)
|
const scale = Math.pow(1.1, this.zoom)
|
||||||
this.xterm.options.fontSize = this.configuredFontSize * scale
|
this.xterm.options.fontSize = this.configuredFontSize * scale
|
||||||
|
Loading…
x
Reference in New Issue
Block a user