Copy pasting from WSL to clipboard crashes the terminal and breaks copypaste system wide with very severe side effects #3938

Closed
opened 2026-01-30 23:33:46 +00:00 by claunia · 11 comments
Owner

Originally created by @Razumihin on GitHub (Sep 19, 2019).

Originally assigned to: @carlos-zamora on GitHub.

Environment

Windows version: 10.0.18362.0
Terminal version: 0.4.2382.0

ESET Endpoint Security Antivirus 7.1.2053.0
Razer Blade 2019 15" laptop with default drivers.

Steps to reproduce

Use WSL on the terminal and copy paste text back and forth from the terminal to other parts of the system. At some point the terminal will crash on copy.

Expected behavior

The string would be on the clipboard and windows would continue functioning properly.

Actual behavior

After the crash I'm fully unable to use Windows clipboard functionalities. Some places like explorer show both copy&paste disabled until restart but also clipboard actions from other software like vim are broken. At the same time radio boxes in Windows UI elements like installers stop working (wtf?) and some of the start menu shortcuts like windows+x also stop functioning until I restart the computer.

This seems rare, but I already reinstalled the system that I'm experiencing this on once, as I thought that some of the system files must be corrupt, but now I'm getting the same problem again. In both cases the first sign of trouble was the copy paste functionality of the terminal and everything else is fully working, so I think it might actually be related even though this seems very obscure.

Originally created by @Razumihin on GitHub (Sep 19, 2019). Originally assigned to: @carlos-zamora on GitHub. # Environment Windows version: 10.0.18362.0 Terminal version: 0.4.2382.0 ESET Endpoint Security Antivirus 7.1.2053.0 Razer Blade 2019 15" laptop with default drivers. # Steps to reproduce Use WSL on the terminal and copy paste text back and forth from the terminal to other parts of the system. At some point the terminal will crash on copy. # Expected behavior The string would be on the clipboard and windows would continue functioning properly. # Actual behavior After the crash I'm fully unable to use Windows clipboard functionalities. Some places like explorer show both copy&paste disabled until restart but also clipboard actions from other software like vim are broken. At the same time radio boxes in Windows UI elements like installers stop working (wtf?) and some of the start menu shortcuts like windows+x also stop functioning until I restart the computer. This seems rare, but I already reinstalled the system that I'm experiencing this on once, as I thought that some of the system files must be corrupt, but now I'm getting the same problem again. In both cases the first sign of trouble was the copy paste functionality of the terminal and everything else is fully working, so I think it might actually be related even though this seems very obscure.
Author
Owner

@zadjii-msft commented on GitHub (Sep 19, 2019):

@carlos-zamora Is this the same as the other clipboard crash?

@zadjii-msft commented on GitHub (Sep 19, 2019): @carlos-zamora Is this the same as the other clipboard crash?
Author
Owner

@carlos-zamora commented on GitHub (Sep 19, 2019):

@carlos-zamora Carlos Zamora FTE Is this the same as the other clipboard crash?

Sounds like it. Particularly the "both copy&paste disabled until restart" part. So, what is going on is that the clipboard stays open. Because it is "in use", no other application is suddently able to use it.

Just to be safe, mind submitting some additional feedback?

/feedback

@carlos-zamora commented on GitHub (Sep 19, 2019): > @carlos-zamora Carlos Zamora FTE Is this the same as the other clipboard crash? Sounds like it. Particularly the "both copy&paste disabled until restart" part. So, what is going on is that the clipboard stays open. Because it is "in use", no other application is suddently able to use it. Just to be safe, mind submitting some additional feedback? /feedback
Author
Owner

@ghost commented on GitHub (Sep 19, 2019):

Hi there!

Can you please send us feedback with the Feedback Hub with this issue and paste the link here so we can more easily find your crash information on the back end?

Thanks!

image image

@ghost commented on GitHub (Sep 19, 2019): Hi there!<br><br>Can you please send us feedback with the Feedback Hub with this issue and paste the link here so we can more easily find your crash information on the back end?<br><br>Thanks!<br><br>![image](https://user-images.githubusercontent.com/18221333/62478757-b69d0d00-b760-11e9-9626-1fa33c91e7c5.png) ![image](https://user-images.githubusercontent.com/18221333/62478649-6de55400-b760-11e9-806e-5aab7e085a9f.png)
Author
Owner

@Razumihin commented on GitHub (Sep 19, 2019):

Sorry about not having Feedback Hub link before, I had to do some work and the Feedback Hub UI is somewhat confusing. Here is a link for you anyway: https://aka.ms/AA63lsi

@Razumihin commented on GitHub (Sep 19, 2019): Sorry about not having Feedback Hub link before, I had to do some work and the Feedback Hub UI is somewhat confusing. Here is a link for you anyway: https://aka.ms/AA63lsi
Author
Owner

@DHowett-MSFT commented on GitHub (Sep 19, 2019):

Somebody remarked that this sounds like you're out of GDI handles. When this happens again, can you launch Task Manager, go to the Details tab, enable the "GDI objects" column and see what's taking up so many of them?

I bet it's not WT.

@DHowett-MSFT commented on GitHub (Sep 19, 2019): Somebody remarked that this sounds like you're out of GDI handles. When this happens again, can you launch Task Manager, go to the Details tab, enable the "GDI objects" column and see what's taking up so many of them? I bet it's not WT.
Author
Owner

@Razumihin commented on GitHub (Sep 20, 2019):

I'll check for GDI objects next time. I'm not that optimistic about that being the reason, as I was not doing anything that would hog up GDI handles yesterday when this occurred.

@Razumihin commented on GitHub (Sep 20, 2019): I'll check for GDI objects next time. I'm not that optimistic about that being the reason, as I was not doing anything that would hog up GDI handles yesterday when this occurred.
Author
Owner

@Razumihin commented on GitHub (Sep 25, 2019):

Okay, got it to crash again with the same symptoms. Most GDI objects were consumed by the task manager itself, so I don't think that's it.

image

@Razumihin commented on GitHub (Sep 25, 2019): Okay, got it to crash again with the same symptoms. Most GDI objects were consumed by the task manager itself, so I don't think that's it. ![image](https://user-images.githubusercontent.com/11144994/65593661-a43d9380-df99-11e9-8054-1693e2275271.png)
Author
Owner

@ghost commented on GitHub (Oct 4, 2019):

:tada:This issue was addressed in #2927, which has now been successfully released as Windows Terminal Preview v0.5.2762.0.🎉

Handy links:

@ghost commented on GitHub (Oct 4, 2019): :tada:This issue was addressed in #2927, which has now been successfully released as `Windows Terminal Preview v0.5.2762.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v0.5.2762.0) * [Store Download](https://www.microsoft.com/store/apps/9n0dx20hk701?cid=storebadge&ocid=badge)
Author
Owner

@torchesburn commented on GitHub (Jan 6, 2023):

this still occurs!

@torchesburn commented on GitHub (Jan 6, 2023): this still occurs!
Author
Owner

@zadjii-msft commented on GitHub (Jan 6, 2023):

@torchesburn This original thread is over 3 years old now. If you're seeing something similar, I'd bet it's due to a different root cause. Mind filing a new issue, so we can follow up on the specifics of whatever you're seeing? Thanks!

@zadjii-msft commented on GitHub (Jan 6, 2023): @torchesburn This original thread is over 3 years old now. If you're seeing something similar, I'd bet it's due to a different root cause. Mind filing a new issue, so we can follow up on the specifics of whatever you're seeing? Thanks!
Author
Owner

@james1236 commented on GitHub (Feb 23, 2023):

All inside WSL, doing sudo apt-get remove xclip and then following the commands to install win32yank taken from here fixed it!

curl -sLo/tmp/win32yank.zip https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x64.zip
unzip -p /tmp/win32yank.zip win32yank.exe > /tmp/win32yank.exe
chmod +x /tmp/win32yank.exe
sudo mv /tmp/win32yank.exe /usr/local/bin/

Specifically for those using neovim, using the clipboard took about 500ms after this, so I had to set vim.opt.clipboard = "" in my config

@james1236 commented on GitHub (Feb 23, 2023): All inside WSL, doing `sudo apt-get remove xclip` and then following the commands to install win32yank [taken from here](https://github.com/neovim/neovim/wiki/FAQ#how-to-use-the-windows-clipboard-from-wsl) fixed it! ``` curl -sLo/tmp/win32yank.zip https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x64.zip unzip -p /tmp/win32yank.zip win32yank.exe > /tmp/win32yank.exe chmod +x /tmp/win32yank.exe sudo mv /tmp/win32yank.exe /usr/local/bin/ ``` Specifically for those using neovim, using the clipboard took about 500ms after this, so I had to set `vim.opt.clipboard = ""` in my config
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3938