Reinstate the (apparently) load-bearing empty bracketed paste#20037
Merged
Reinstate the (apparently) load-bearing empty bracketed paste#20037
Conversation
Some applications have come to rely on an "empty" bracketed paste packet to indicate that the clipboard was _requested,_ but not sent. Some agentic CLI tools use this to guess whether the clipboard contained e.g. an image or otherwise unserializable data. Apparently, gnome-terminal and VS Code do this; others as well (I tested xterm, konsole, gnome-terminal and I can't remember which ones did and which ones did not.) Refs #19517
DHowett
commented
Mar 30, 2026
| // Bracketed Paste provides an application a way to know whether the | ||
| // user pasted, even if there was no applicable content on it. This | ||
| // behavior is observed in GNOME Terminal, among others. | ||
| if (!bracketedPaste && text.empty()) |
Member
Author
There was a problem hiding this comment.
this will act just as squirrely as pasting in broadcast already does, so, whatever. I'll fix it in post.
benediktjohannes
approved these changes
Mar 30, 2026
Contributor
benediktjohannes
left a comment
There was a problem hiding this comment.
This is awesome! Thanks! 👍
lhecker
approved these changes
Mar 30, 2026
Member
|
I probably broke it when I rewrote it pasting to use Win32 APIs huh? I bet I added the early return then. |
Member
Author
|
Indeed! Not a huge problem tho. We may want to fix it for conhost too |
DHowett
added a commit
that referenced
this pull request
Mar 31, 2026
Some applications have come to rely on an "empty" bracketed paste packet to indicate that the clipboard was _requested,_ but not sent. Some agentic CLI tools use this to guess whether the clipboard contained e.g. an image or otherwise unserializable data. Apparently, gnome-terminal and VS Code do this; others as well (I tested xterm, konsole, gnome-terminal and I can't remember which ones did and which ones did not.) Refs #19517 (cherry picked from commit 2870a70) Service-Card-Id: PVTI_lADOAF3p4s4BQX0-zgotgA4 Service-Version: 1.25
DHowett
added a commit
that referenced
this pull request
Mar 31, 2026
Some applications have come to rely on an "empty" bracketed paste packet to indicate that the clipboard was _requested,_ but not sent. Some agentic CLI tools use this to guess whether the clipboard contained e.g. an image or otherwise unserializable data. Apparently, gnome-terminal and VS Code do this; others as well (I tested xterm, konsole, gnome-terminal and I can't remember which ones did and which ones did not.) Refs #19517 (cherry picked from commit 2870a70) Service-Card-Id: PVTI_lADOAF3p4s4BBcTlzgotgA8 Service-Version: 1.24
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.
Some applications have come to rely on an "empty" bracketed paste packet to indicate that the clipboard was requested, but not sent. Some agentic CLI tools use this to guess whether the clipboard contained e.g. an image or otherwise unserializable data.
Apparently, gnome-terminal and VS Code do this; others as well (I tested xterm, konsole, gnome-terminal and I can't remember which ones did and which ones did not.)
Refs #19517