From da28596968e2dbd0a07ae84d084a0c4916f18cf0 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sun, 22 Aug 2021 20:12:23 +0200 Subject: [PATCH] handle shift-insert through hotkeys system - fixes #3565, fixes #4451 --- tabby-terminal/src/api/baseTerminalTab.component.ts | 2 +- tabby-terminal/src/config.ts | 2 ++ tabby-terminal/src/frontends/xtermFrontend.ts | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tabby-terminal/src/api/baseTerminalTab.component.ts b/tabby-terminal/src/api/baseTerminalTab.component.ts index 4d6ccde7..62b86366 100644 --- a/tabby-terminal/src/api/baseTerminalTab.component.ts +++ b/tabby-terminal/src/api/baseTerminalTab.component.ts @@ -594,7 +594,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit this.termContainerSubscriptions.subscribe(this.focused$, () => this.frontend && (this.frontend.enableResizing = true)) this.termContainerSubscriptions.subscribe(this.blurred$, () => this.frontend && (this.frontend.enableResizing = false)) - this.termContainerSubscriptions.subscribe(this.frontend.mouseEvent$, async event => { + this.termContainerSubscriptions.subscribe(this.frontend.mouseEvent$, event => { if (event.type === 'mousedown') { if (event.which === 1) { this.cancelFocusAllPanes() diff --git a/tabby-terminal/src/config.ts b/tabby-terminal/src/config.ts index 9c1808b9..71c6e3ca 100644 --- a/tabby-terminal/src/config.ts +++ b/tabby-terminal/src/config.ts @@ -120,6 +120,7 @@ export class TerminalConfigProvider extends ConfigProvider { ], paste: [ 'Ctrl-Shift-V', + 'Shift-Insert', ], 'select-all': ['Ctrl-Shift-A'], clear: [], @@ -159,6 +160,7 @@ export class TerminalConfigProvider extends ConfigProvider { ], paste: [ 'Ctrl-Shift-V', + 'Shift-Insert', ], 'select-all': ['Ctrl-Shift-A'], clear: [], diff --git a/tabby-terminal/src/frontends/xtermFrontend.ts b/tabby-terminal/src/frontends/xtermFrontend.ts index d19aef97..b1938b2d 100644 --- a/tabby-terminal/src/frontends/xtermFrontend.ts +++ b/tabby-terminal/src/frontends/xtermFrontend.ts @@ -97,7 +97,10 @@ export class XTermFrontend extends Frontend { this.xterm.attachCustomKeyEventHandler((event: KeyboardEvent) => { if (this.hostApp.platform !== Platform.Web) { - if (event.getModifierState('Meta') && event.key.toLowerCase() === 'v') { + if ( + event.getModifierState('Meta') && event.key.toLowerCase() === 'v' || + event.key === 'Insert' && event.shiftKey + ) { event.preventDefault() return false }