fix(tabby-terminal): set selected text into search box on opening

This commit is contained in:
Clem Fern 2023-04-28 17:17:58 +02:00
parent 9978e0b86f
commit bb6ed52291

View File

@ -212,6 +212,11 @@ export class BaseTerminalTabComponent<P extends BaseTerminalProfile> 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()
})