Skip to content

Paste clipboard file resource in terminal when text is empty#307501

Merged
anthonykim1 merged 3 commits into
mainfrom
anthonykim1/supportCtrlcVImage
Apr 2, 2026
Merged

Paste clipboard file resource in terminal when text is empty#307501
anthonykim1 merged 3 commits into
mainfrom
anthonykim1/supportCtrlcVImage

Conversation

@anthonykim1

@anthonykim1 anthonykim1 commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

@anthonykim1 anthonykim1 self-assigned this Apr 2, 2026
Copilot AI review requested due to automatic review settings April 2, 2026 20:12
@anthonykim1 anthonykim1 added this to the 1.115.0 milestone Apr 2, 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.

Pull request overview

This PR improves terminal paste behavior by falling back to clipboard “resources” (e.g. copied files) when the clipboard has no text, enabling pasting a file path into the integrated terminal.

Changes:

  • Update TerminalClipboardContribution.paste() to use the first clipboard resource’s path when readText() is empty.
  • Add unit tests covering text paste, resource fallback, and empty clipboard behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/workbench/contrib/terminalContrib/clipboard/browser/terminal.clipboard.contribution.ts Adds resource-based fallback logic when clipboard text is empty.
src/vs/workbench/contrib/terminalContrib/clipboard/test/browser/terminalClipboard.test.ts Adds tests validating the new paste behavior and edge cases.

@anthonykim1 anthonykim1 changed the title Paste clipboard resource in terminal when text is empty Paste clipboard file resource in terminal when text is empty Apr 2, 2026
@anthonykim1 anthonykim1 marked this pull request as ready for review April 2, 2026 22:29
@anthonykim1 anthonykim1 merged commit bbf7bc4 into main Apr 2, 2026
19 checks passed
@anthonykim1 anthonykim1 deleted the anthonykim1/supportCtrlcVImage branch April 2, 2026 22:53
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators May 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ctrl+c/v to paste an image to the terminal

3 participants