Skip to content

Fix terminal-editor shift-drop on detached instances - #335945

Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
agents/fix-terminal-editor-shift-drop-bug
Sep 12, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
agents/fix-terminal-editor-shift-drop-bug

Conversation

@dmitrivMS

@dmitrivMS Dmitriy Vasyura (dmitrivMS) commented Sep 12, 2026 •

Copy link
Copy Markdown
Collaborator
  • dispose terminal drag-and-drop observers when their instances detach from an editor container
  • prevent deferred drag-and-drop initialization from attaching to a stale container
  • add regression coverage for initialized and pending observers during terminal editor tab reuse

Fixes #311164

Co-authored-by: Vlad Gerasimov [email protected]

Dispose the drag-and-drop observer when a terminal detaches and prevent deferred initialization from targeting a stale container. Add regression coverage for both initialized and pending observers during terminal editor tab reuse.

Fixes #311164

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 12, 2026 08:42
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added workbench-dnd Drag-and-drop issues terminal General terminal issues that don't fall under another label labels Sep 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The lifecycle fix is narrowly scoped and both relevant race conditions have regression coverage.

Review tier: Balanced
Findings: None

What changed in this PR

Fixes terminal editor drag-and-drop observers persisting after tab reuse.

Changes:

  • Dispose drag-and-drop observers when detaching terminals.
  • Guard deferred initialization against stale containers.
  • Add regression tests for initialized and pending observers.
File Description
terminalInstance.ts Corrects drag-and-drop observer lifecycle.
terminalInstance.test.ts Covers detach and deferred-initialization scenarios.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: a8f49160 Current: bcdb178f

Changed (2)

imageCarousel/imageCarousel/SingleSectionMiddleImage/Dark
Before After
before after
imageCarousel/imageCarousel/SingleSectionMiddleImage/Light
Before After
before after

2 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details.

@dmitrivMS

Copy link
Copy Markdown
Collaborator Author

Thanks Dmitriy Vasyura (Dmitriy Vasyura (@dmitrivMS)) for adding the expanded end-to-end regression tests and carrying the fix forward from #332908!

Could you please include: Co-authored-by: Ultron09 <[email protected]> in the commit/squash message so contributor attribution is preserved upon merge? Thank you!

Hmm... I didn't use your PR at all. I can add Co-authored-by: Vlad Gerasimov [email protected]

@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Anthony Kim (@anthonykim1)

Matched files:

  • src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
  • src/vs/workbench/contrib/terminal/test/browser/terminalInstance.test.ts

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 9e9bd55 into main Sep 12, 2026
61 of 63 checks passed
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) deleted the agents/fix-terminal-editor-shift-drop-bug branch September 12, 2026 17:05
Abdon Morales (abdonmorales) pushed a commit to abdonmorales/vscode-utcs that referenced this pull request Sep 23, 2026
Dispose the drag-and-drop observer when a terminal detaches and prevent deferred initialization from targeting a stale container. Add regression coverage for both initialized and pending observers during terminal editor tab reuse.

Fixes microsoft#311164

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Vlad Gerasimov [email protected]
(cherry picked from commit 9e9bd55)
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Oct 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

terminal General terminal issues that don't fall under another label workbench-dnd Drag-and-drop issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dragging a file into one terminal editor while holding Shift inserts the path into other terminal editors as well

4 participants