Rewrite the copy-to-clipboard functionality to use the Win32 functions #21254

Closed
opened 2026-01-31 07:37:50 +00:00 by claunia · 9 comments
Owner

Originally created by @dgloverproofpoint on GitHub (Feb 14, 2024).

Windows Terminal version

1.18.10301.0

Windows build number

10.0.19045.3930

Other Software

No response

Steps to reproduce

  1. Select output
  2. [CTRL + C] or [right click] or [CTRL + Shift + P (command palette -> "Copy Text" option]
  3. Neither [CTRL + V] pastes nor does [Win + V] have the selected and presumably copied text in the clipboard

Expected Behavior

Expecting copy from terminal into Windows Clipboard and paste into other programs to work as normal.

Actual Behavior

No text copied to clipboard. I can, at times, get it to continue functionality if I un-snap the Windows Terminal window from fullscreen view but this is only intermittently successful.

This happens whether my shell is ssh'ed to another machine or running locally.

Other programs continue to copy to clipboard and paste to other programs perfectly fine.

Originally created by @dgloverproofpoint on GitHub (Feb 14, 2024). ### Windows Terminal version 1.18.10301.0 ### Windows build number 10.0.19045.3930 ### Other Software _No response_ ### Steps to reproduce 1) Select output 2) [CTRL + C] or [right click] or [CTRL + Shift + P (command palette -> "Copy Text" option] 3) Neither [CTRL + V] pastes nor does [Win + V] have the selected and presumably copied text in the clipboard ### Expected Behavior Expecting copy from terminal into Windows Clipboard and paste into other programs to work as normal. ### Actual Behavior No text copied to clipboard. I can, at times, get it to continue functionality if I un-snap the Windows Terminal window from fullscreen view but this is only intermittently successful. This happens whether my shell is ssh'ed to another machine or running locally. Other programs continue to copy to clipboard and paste to other programs perfectly fine.
claunia added the Issue-TaskNeeds-Tag-FixArea-InteractionProduct-Terminal labels 2026-01-31 07:37:50 +00:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 14, 2024):

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@github-actions[bot] commented on GitHub (Feb 14, 2024): Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! ### Closed similar issues: - [Copying text from terminal doesn't seem to work on Windows 11 (#11475)](https://github.com/microsoft/terminal/issues/11475), similarity score: 0.81 - [select + enter does not copy selected text into clipboard just as old Terminal (#3179)](https://github.com/microsoft/terminal/issues/3179), similarity score: 0.79 > Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Author
Owner

@lhecker commented on GitHub (Feb 14, 2024):

Maybe we need to rewrite the copy-to-clipboard functionality to use the Win32 functions as well. But 's fairly likely that your machine is having issues right now, like background applications trying to acquire the clipboard lock all the time, etc. May be worth trying to reboot / exiting all background applications, just in case.

@lhecker commented on GitHub (Feb 14, 2024): Maybe we need to rewrite the copy-to-clipboard functionality to use the Win32 functions as well. But 's fairly likely that your machine is having issues right now, like background applications trying to acquire the clipboard lock all the time, etc. May be worth trying to reboot / exiting all background applications, just in case.
Author
Owner

@carlos-zamora commented on GitHub (Feb 14, 2024):

Thanks for filing. Per Leonard's comment above, we'll repurpose this issue to track rewriting the clipboard code to use Win32 functions.

@carlos-zamora commented on GitHub (Feb 14, 2024): Thanks for filing. Per Leonard's comment above, we'll repurpose this issue to track rewriting the clipboard code to use Win32 functions.
Author
Owner

@akantak commented on GitHub (Mar 27, 2024):

Same here on Terminal Windows Version: 1.19.10573.0 and Windows 11 23H2 OS Build 22631.3296.
The copy mechanism from the terminal randomly stops/starts working. It has been happening for a few weeks now.
I would appreciate any workaround (if any known). For now, it is only waiting until it randomly starts working once again.

@akantak commented on GitHub (Mar 27, 2024): Same here on `Terminal Windows Version: 1.19.10573.0` and `Windows 11 23H2 OS Build 22631.3296`. The copy mechanism from the terminal randomly stops/starts working. It has been happening for a few weeks now. I would appreciate any workaround (if any known). For now, it is only waiting until it randomly starts working once again.
Author
Owner

@zadjii commented on GitHub (Mar 11, 2025):

Did we fix this in #17006?

@zadjii commented on GitHub (Mar 11, 2025): Did we fix this in #17006?
Author
Owner

@lhecker commented on GitHub (Mar 11, 2025):

Yes!

@lhecker commented on GitHub (Mar 11, 2025): Yes!
Author
Owner

@Neme12 commented on GitHub (Mar 14, 2025):

Why isn't the WinRT functionality fixed, instead of reverting to a much older API?

@Neme12 commented on GitHub (Mar 14, 2025): Why isn't the WinRT functionality fixed, instead of reverting to a much older API?
Author
Owner

@lhecker commented on GitHub (Mar 14, 2025):

Internally I let its maintainers know about this a long time ago. We don't do anything about this ourselves, because everyone on this team is already booked out with our own work for months on end.

@lhecker commented on GitHub (Mar 14, 2025): Internally I let its maintainers know about this a long time ago. We don't do anything about this ourselves, because everyone on this team is already booked out with our own work for months on end.
Author
Owner

@DHowett commented on GitHub (Mar 14, 2025):

@neme12 in addition to what @lhecker said above, I'll add that switching to the Win32 API is a great way for us to help customers now, even if they are on Windows 10 (which, if the team rewrites the WinRT API, will almost certainly never get the fix!)

Yes, the platform should be fixed. But doing that isn't our only option. 🙂

@DHowett commented on GitHub (Mar 14, 2025): @neme12 in addition to what @lhecker said above, I'll add that switching to the Win32 API is a great way for us to help customers *now*, even if they are on Windows 10 (which, if the team rewrites the WinRT API, will almost certainly never get the fix!) Yes, the platform should be fixed. But doing that isn't our only option. 🙂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21254