[PR #15360] Replace WinRT clipboard API with Win32 for pasting #30612

Open
opened 2026-01-31 09:41:51 +00:00 by claunia · 0 comments
Owner

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

State: closed
Merged: Yes


The Win32 API is significantly faster than the WinRT one, in the order
of around 300-1000x depending on the CPU and CPU load.

This might slightly improve the situation around #15315, but I suspect
that it requires many more fixes. For instance, we don't really have a
single text input "queue" into which we write. Multiple routines that
resume_background just to WriteFile into the input pipe are thus
racing against each other, contributing to the laggy feeling.
I also fear that the modern Windows text stack might be inherently
RPC based too, producing worse lag with rising CPU load.

This might fix #14323

Validation Steps Performed

  • Paste text from Edge
  • Paste text from Notepad
  • Right click the address bar in Explorer, choose "Copy address",
    paste text into WT
**Original Pull Request:** https://github.com/microsoft/terminal/pull/15360 **State:** closed **Merged:** Yes --- The Win32 API is significantly faster than the WinRT one, in the order of around 300-1000x depending on the CPU and CPU load. This might slightly improve the situation around #15315, but I suspect that it requires many more fixes. For instance, we don't really have a single text input "queue" into which we write. Multiple routines that `resume_background` just to `WriteFile` into the input pipe are thus racing against each other, contributing to the laggy feeling. I also fear that the modern Windows text stack might be inherently RPC based too, producing worse lag with rising CPU load. This might fix #14323 ## Validation Steps Performed * Paste text from Edge ✅ * Paste text from Notepad ✅ * Right click the address bar in Explorer, choose "Copy address", paste text into WT ✅
claunia added the pull-request label 2026-01-31 09:41:51 +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#30612