From bb6ed52291521a29486140e3a416c1d3d4203276 Mon Sep 17 00:00:00 2001 From: Clem Fern Date: Fri, 28 Apr 2023 17:17:58 +0200 Subject: [PATCH] fix(tabby-terminal): set selected text into search box on opening --- tabby-terminal/src/api/baseTerminalTab.component.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tabby-terminal/src/api/baseTerminalTab.component.ts b/tabby-terminal/src/api/baseTerminalTab.component.ts index f6a5a619..dcea967d 100644 --- a/tabby-terminal/src/api/baseTerminalTab.component.ts +++ b/tabby-terminal/src/api/baseTerminalTab.component.ts @@ -212,6 +212,11 @@ export class BaseTerminalTabComponent

extends Bas this.showSearchPanel = true setImmediate(() => { const input = this.element.nativeElement.querySelector('.search-input') + const selectedText = (this.frontend?.getSelection() ?? '').trim() + if (input && selectedText.length) { + input.value = selectedText + } + input?.focus() input?.select() })