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
Open
Allow clipboard events to fall through to system clipboard for OSC52 support in code serve-web#318255justin39 wants to merge 2 commits into
code serve-web#318255justin39 wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
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/writeTextbehavior 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. |
|
|
||
| // 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #318254 by allowing clipboard events of type
clipboardto access the code path for the system clipboard.There is a comment that claims that only in-memory storage is supported with
typewhich makes sense for the other two buffer targets, but I'm not sure why that would apply totype: clipboardtargeting the system clipboard.Tested by running

./scripts/code-server.shand sending a OSC52 snippet in the terminal: