diff --git a/.all-contributorsrc b/.all-contributorsrc index 559947a1..241d0391 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1157,6 +1157,15 @@ "contributions": [ "financial" ] + }, + { + "login": "Kapocsi", + "name": "Thomas Kapocsi", + "avatar_url": "https://avatars.githubusercontent.com/u/84490604?v=4", + "profile": "http://kapocsi.ca", + "contributions": [ + "doc" + ] } ], "contributorsPerLine": 7, diff --git a/HACKING.md b/HACKING.md index 2e45ec80..31230aeb 100644 --- a/HACKING.md +++ b/HACKING.md @@ -42,13 +42,13 @@ yarn start To build an installer, first complete a "normal" build as described above and then run: ``` -node scripts/prepackage-plugins.js +node scripts/prepackage-plugins.mjs -node scripts/build-windows.js +node scripts/build-windows.mjs # or -node scripts/build-linux.js +node scripts/build-linux.mjs # or -node scripts/build-macos.js +node scripts/build-macos.mjs ``` The artifacts will be produced in the `dist` folder. diff --git a/README.de-DE.md b/README.de-DE.md index 0774c057..374cc271 100644 --- a/README.de-DE.md +++ b/README.de-DE.md @@ -154,168 +154,173 @@ Dank geht an diese wunderbaren Menschen ([emoji key](https://allcontributors.org
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() }) diff --git a/tabby-terminal/src/frontends/xtermFrontend.ts b/tabby-terminal/src/frontends/xtermFrontend.ts index fe6b7dc2..88951c2a 100644 --- a/tabby-terminal/src/frontends/xtermFrontend.ts +++ b/tabby-terminal/src/frontends/xtermFrontend.ts @@ -69,6 +69,7 @@ export class XTermFrontend extends Frontend { private resizeHandler: () => void private configuredTheme: ITheme = {} private copyOnSelect = false + private preventNextOnSelectionChangeEvent = false private search = new SearchAddon() private searchState: SearchState = { resultCount: 0 } private fitAddon = new FitAddon() @@ -116,8 +117,11 @@ export class XTermFrontend extends Frontend { this.title.next(title) }) this.xterm.onSelectionChange(() => { - if (this.copyOnSelect && this.getSelection()) { - this.copySelection() + if (this.getSelection()) { + if (this.copyOnSelect && !this.preventNextOnSelectionChangeEvent) { + this.copySelection() + } + this.preventNextOnSelectionChangeEvent = false } }) this.xterm.onBell(() => { @@ -444,12 +448,18 @@ export class XTermFrontend extends Frontend { } findNext (term: string, searchOptions?: SearchOptions): SearchState { + if (this.copyOnSelect) { + this.preventNextOnSelectionChangeEvent = true + } return this.wrapSearchResult( this.search.findNext(term, this.getSearchOptions(searchOptions)), ) } findPrevious (term: string, searchOptions?: SearchOptions): SearchState { + if (this.copyOnSelect) { + this.preventNextOnSelectionChangeEvent = true + } return this.wrapSearchResult( this.search.findPrevious(term, this.getSearchOptions(searchOptions)), )