Skip to content

Improve the local to native and remote to local copy, paste, and DND experience#320685

Merged
lramos15 merged 3 commits into
mainfrom
lramos15/xerothermic-gopher
Jun 11, 2026
Merged

Improve the local to native and remote to local copy, paste, and DND experience#320685
lramos15 merged 3 commits into
mainfrom
lramos15/xerothermic-gopher

Conversation

@lramos15

@lramos15 lramos15 commented Jun 9, 2026

Copy link
Copy Markdown
Member
Copilot AI review requested due to automatic review settings June 9, 2026 22:08
@lramos15 lramos15 enabled auto-merge (squash) June 9, 2026 22:08
@lramos15 lramos15 self-assigned this Jun 9, 2026
@lramos15 lramos15 requested review from deepak1556 and mjbvz June 9, 2026 22:08
@lramos15 lramos15 disabled auto-merge June 9, 2026 22:08
@lramos15 lramos15 requested a review from joshspicer June 9, 2026 22:14

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 cross-environment file transfer in VS Code desktop by enhancing clipboard and drag-and-drop handling for local vs remote resources, and by adding a cross-window proxy for accessing vscode-remote:// files from windows that don’t own the remote connection.

Changes:

  • Write/read platform-native file clipboard formats (macOS/Linux/Windows) in the Electron clipboard service to improve native paste into OS file managers.
  • Download remote explorer selections to a local temp cache for native paste support, with a fallback path that relies on a new cross-window remote filesystem proxy.
  • Introduce a main/renderer IPC-based “remote filesystem proxy” so local windows can read vscode-remote:// resources via the window that owns the remote connection, plus basic unit tests.
Show a summary per file
File Description
src/vs/workbench/services/clipboard/electron-browser/clipboardService.ts Adds platform-native clipboard formats for file copy/paste and fallback reading behavior.
src/vs/workbench/electron-browser/desktop.main.ts Wires proxy server/client registration into desktop workbench startup.
src/vs/workbench/contrib/files/browser/explorerService.ts Downloads remote clipboard resources to local temp file:// URIs for native paste.
src/vs/workbench/browser/dnd.ts Avoids exporting remote URIs as plain text during drag to native apps (prevents e.g. macOS .webloc).
src/vs/platform/files/test/electron-main/remoteFileSystemProxy.test.ts Adds coverage for main-process routing logic.
src/vs/platform/files/electron-main/remoteFileSystemProxyMainHandler.ts Adds main-process router that forwards operations to the correct renderer window by remote authority.
src/vs/platform/files/electron-browser/remoteFileSystemProxyServer.ts Adds renderer-side server channel exposing file operations to other windows via main routing.
src/vs/platform/files/electron-browser/remoteFileSystemProxyClient.ts Adds local-window proxy provider for vscode-remote scheme (read-only) routed via the main process.
src/vs/platform/files/common/remoteFileSystemProxy.ts Defines IPC channel name constants for proxy wiring.
src/vs/code/electron-main/app.ts Registers the main-process proxy handler channel during app startup.

Copilot's findings

  • Files reviewed: 10/10 changed files
  • Comments generated: 4
Comment thread src/vs/workbench/contrib/files/browser/explorerService.ts
// We replace remote URIs with local file:// URIs pointing to temp copies.
const clipboardResources = await this.resolveClipboardResources(resources);

await this.clipboardService.writeResources(clipboardResources);

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.

Not sure if this idea will work but I feel like the temp file stuff isn't right. A few concerns:

  • We are creating the file eagerly on copy and blocking the copy on this.
  • I worry about leaking the /tmp file path

Instead, the web clipboard api should support writing a Promise that resolves to a Blob: https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem/ClipboardItem

I believe that electron is exploring aligning their clipboard API more with this web api too: electron/electron#51707

Maybe @deepak1556 can weight on what we can do for electron

@lramos15 lramos15 enabled auto-merge (squash) June 10, 2026 20:27
@lramos15 lramos15 disabled auto-merge June 10, 2026 20:27
@lramos15 lramos15 enabled auto-merge (squash) June 11, 2026 22:00
@lramos15 lramos15 merged commit f9070ac into main Jun 11, 2026
25 checks passed
@lramos15 lramos15 deleted the lramos15/xerothermic-gopher branch June 11, 2026 22:00
@vs-code-engineering vs-code-engineering Bot added this to the 1.125.0 milestone Jun 11, 2026
lramos15 added a commit that referenced this pull request Jun 15, 2026
lramos15 added a commit that referenced this pull request Jun 29, 2026
lramos15 pushed a commit that referenced this pull request Jun 29, 2026
… copy, paste, and DND experience (#320685)" (#323502)

Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants