Skip to content

Allow clipboard events to fall through to system clipboard for OSC52 support in code serve-web#318255

Open
justin39 wants to merge 2 commits into
microsoft:mainfrom
justin39:clipboard-osc52-fallback
Open

Allow clipboard events to fall through to system clipboard for OSC52 support in code serve-web#318255
justin39 wants to merge 2 commits into
microsoft:mainfrom
justin39:clipboard-osc52-fallback

Conversation

@justin39
Copy link
Copy Markdown
Contributor

Closes #318254 by allowing clipboard events of type clipboard to access the code path for the system clipboard.

There is a comment that claims that only in-memory storage is supported with type which makes sense for the other two buffer targets, but I'm not sure why that would apply to type: clipboard targeting the system clipboard.

Tested by running ./scripts/code-server.sh and sending a OSC52 snippet in the terminal:
image

Copilot AI review requested due to automatic review settings May 25, 2026 22:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adjusts browser clipboard behavior so an explicit type: 'clipboard' is treated as the default/system clipboard rather than forcing the in-memory typed clipboard path.

Changes:

  • Excludes type === 'clipboard' from the “typed/in-memory clipboard” branch in both workbench and platform browser clipboard services.
  • Aligns readText/writeText behavior so 'clipboard' behaves like “no type”.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/vs/workbench/services/clipboard/browser/clipboardService.ts Treats type: 'clipboard' as default by routing to super.readText only for non-clipboard typed reads.
src/vs/platform/clipboard/browser/clipboardService.ts Treats type: 'clipboard' as default by routing non-clipboard types to the in-memory map for reads/writes.

Comment thread src/vs/platform/clipboard/browser/clipboardService.ts Outdated

// With type: only in-memory is supported
if (type) {
if (type && type !== 'clipboard') {
this.logService.trace('BrowserClipboardService#readText called with type:', type);
// With type: only in-memory is supported
if (type) {
if (type && type !== 'clipboard') {
}

if (type) {
if (type && type !== 'clipboard') {
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OSC52 unsupported in code serve-web

4 participants