Skip to content

Reinstate the (apparently) load-bearing empty bracketed paste#20037

Merged
DHowett merged 1 commit intomainfrom
dev/duhowett/load-bearing-empty-paste-lol
Mar 31, 2026
Merged

Reinstate the (apparently) load-bearing empty bracketed paste#20037
DHowett merged 1 commit intomainfrom
dev/duhowett/load-bearing-empty-paste-lol

Conversation

@DHowett
Copy link
Copy Markdown
Member

@DHowett DHowett commented Mar 30, 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

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
// 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())
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this will act just as squirrely as pasting in broadcast already does, so, whatever. I'll fix it in post.

Copy link
Copy Markdown
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

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

✅ Welp

Copy link
Copy Markdown
Contributor

@benediktjohannes benediktjohannes left a comment

Choose a reason for hiding this comment

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

This is awesome! Thanks! 👍

@lhecker
Copy link
Copy Markdown
Member

lhecker commented Mar 31, 2026

I probably broke it when I rewrote it pasting to use Win32 APIs huh? I bet I added the early return then.

@DHowett
Copy link
Copy Markdown
Member Author

DHowett commented Mar 31, 2026

Indeed! Not a huge problem tho. We may want to fix it for conhost too

@DHowett DHowett merged commit 2870a70 into main Mar 31, 2026
20 checks passed
@DHowett DHowett deleted the dev/duhowett/load-bearing-empty-paste-lol branch March 31, 2026 00:00
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.24 Servicing Pipeline Mar 31, 2026
@DHowett DHowett moved this from To Cherry Pick to Cherry Picked in 1.25 Servicing Pipeline Mar 31, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Cherry Picked
Status: Cherry Picked

Development

Successfully merging this pull request may close these issues.

4 participants