Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: skip copy-on-select when search bar has focus
Navigating search results in the terminal causes xterm.js to change the
selection programmatically, which was triggering copy-on-select and
clobbering the clipboard. Skip the clipboard write when an element
inside .search-container is the active element.
  • Loading branch information
Shay12tg committed Mar 10, 2026
commit 0c7392ec7a92d9d82942bf58d86a6b017d3d2be7
6 changes: 6 additions & 0 deletions frontend/app/view/term/termwrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,12 @@ export class TermWrap {
if (!globalStore.get(copyOnSelectAtom)) {
return;
}
// Don't copy-on-select when the search bar has focus — navigating
// search results changes the terminal selection programmatically.
const active = document.activeElement;
if (active != null && active.closest(".search-container") != null) {
return;
}
const selectedText = this.terminal.getSelection();
if (selectedText.length > 0) {
navigator.clipboard.writeText(selectedText);
Expand Down