terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Indicate support for OSC 52 in the DA1 report

Open j4james opened this issue 5 months ago • 1 comments

Summary of the Pull Request

Some applications that make use of the OSC 52 clipboard sequence will only do so if they can be certain that the terminal actually has that functionality. Indicating our support for OSC 52 in the DA1 report will give them an easy way to detect that.

References and Relevant Issues

OSC 52 support was added to Windows Terminal in issue #5823, and to ConHost in issue #18949.

Detailed Description of the Pull Request / Additional comments

Support for writing to the clipboard is indicated in the primary device attributes report by the extension parameter 52. This is obviously not a standard DEC extension, but it's one that's been agreed upon by a number of modern terminals. The extension is only reported when writing to the clipboard is actually permitted (Windows Terminal has an option to disable that).

Validation Steps Performed

I've updated the Device Attributes unit test to check that we're reporting extension 52 when clipboard access is enabled, and not reporting it when disabled.

PR Checklist

  • [x] Closes #19017
  • [x] Tests added/passed

j4james avatar Jun 14 '25 00:06 j4james

Thank you for reaching out to all the other terminals/applications as well! I've read through some of them, and one in particular was quite bemusing. 😄

lhecker avatar Jun 16 '25 13:06 lhecker

/azp run

DHowett avatar Jun 19 '25 00:06 DHowett

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jun 19 '25 00:06 azure-pipelines[bot]