[PR #5823] Add support for OSC 52 (copy-to-clipboard) #26494

Closed
opened 2026-01-31 09:16:25 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/5823

State: closed
Merged: Yes


With this commit, terminal will be able to copy text to the system
clipboard by using OSC 52 MANIPULATE SELECTION DAATA.

We chose not to implement the clipboard querying functionality offered
by OSC 52, as sending the clipboard text to an application without the
user's knowledge or consent is an immense security hole.

We do not currently support the clipboard specifier Pc to specify which
clipboard buffer should be filled

Base64 encoded foo

$ echo -en "\e]52;;Zm9v\a"

Multiple lines

Base64 encoded foo\r\nbar

$ echo -en "\e]52;;Zm9vDQpiYXI=\a"

Closes #2946.

**Original Pull Request:** https://github.com/microsoft/terminal/pull/5823 **State:** closed **Merged:** Yes --- With this commit, terminal will be able to copy text to the system clipboard by using OSC 52 MANIPULATE SELECTION DAATA. We chose not to implement the clipboard querying functionality offered by OSC 52, as sending the clipboard text to an application without the user's knowledge or consent is an immense security hole. We do not currently support the clipboard specifier Pc to specify which clipboard buffer should be filled # Base64 encoded `foo` $ echo -en "\e]52;;Zm9v\a" # Multiple lines # Base64 encoded `foo\r\nbar` $ echo -en "\e]52;;Zm9vDQpiYXI=\a" Closes #2946.
claunia added the pull-request label 2026-01-31 09:16:25 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26494