Skip to content

Use current document for mouse listeners #6019

Merged
anthonykim1 merged 4 commits into
xtermjs:masterfrom
anthonykim1:anthonykim1/fix-terminal-window-mouse-listeners
Jun 28, 2026
Merged

Use current document for mouse listeners #6019
anthonykim1 merged 4 commits into
xtermjs:masterfrom
anthonykim1:anthonykim1/fix-terminal-window-mouse-listeners

Conversation

@anthonykim1

@anthonykim1 anthonykim1 commented Jun 17, 2026

Copy link
Copy Markdown
Member

For context and img description of the problem: microsoft/vscode#307196

  • TL;DR: Selection does not work on CLIs such as Copilot CLI or Claude code on dedicated terminal window.
  • Open via: workbench.action.terminal.newInNewWindow aka Terminal: New Terminal Window command in VS Code.

Changes in this PR:

  • Attach transient protocol mouse listeners to the terminal element’s current ownerDocument, so mouse drag/release events work after the terminal moves into another window.
  • Manage those transient listeners with MutableDisposables, so cleanup removes them from the exact document they were attached to without manually tracking the document.

After this PR:
Screenshot 2026-06-16 at 7 15 10 PM

@anthonykim1 anthonykim1 added this to the 7.0.0 milestone Jun 17, 2026
@anthonykim1 anthonykim1 self-assigned this Jun 17, 2026
@anthonykim1 anthonykim1 requested review from Tyriar and jerch June 17, 2026 02:47
@anthonykim1 anthonykim1 marked this pull request as ready for review June 17, 2026 02:47
@anthonykim1 anthonykim1 merged commit 8aab310 into xtermjs:master Jun 28, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant