Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipboard with single character returns garbage via win32 interoperability #3716

Closed
am11 opened this issue Dec 15, 2018 · 6 comments
Closed

Comments

@am11
Copy link

am11 commented Dec 15, 2018

This issue is also reproducible with MinGW64 and I am not sure what is the common denominator between WSL and MinGW. Please let me know if it belongs to a different repository / issue tracker.

:: get the OS version
C:\>ver

Microsoft Windows [Version 10.0.18298.1000]

:: enter some WSL distro
C:\>alpine
# get the OS version
~:❄️ $ cat /etc/os-release | grep VERSION
VERSION_ID=3.8.0

# test copy and paste using win32 interoperability
~:❄️ $ echo HelloWorld! | clip.exe; powershell.exe -noprofile -command Get-Clipboard
HelloWorld!

# test the same thing with single character to get weird character
~:❄️ $ echo 1 | clip.exe; powershell.exe -noprofile -command Get-Clipboard
਱

# same problem with an alphabet
~:❄️ $ echo a | clip.exe; powershell.exe -noprofile -command Get-Clipboard
੡

# with two or more characters, it works fine
~:❄️ $ echo A1 | clip.exe; powershell.exe -noprofile -command Get-Clipboard
A1

Get-Clipboard cmdlet or pasting with keyboard/mouse in any editor gives the same character.

@therealkenc
Copy link
Collaborator

Nice. Was able to reproduce here. No doubt this is an edge case in the two byte encoding on Windows and one byte WSL/Linux. Legit, thanks.

@therealkenc
Copy link
Collaborator

Try this. It's fun.

image

@therealkenc
Copy link
Collaborator

Forward dupe up to #4852 where there is some more investigation. The OP scenario is pretty clearly the same.

I am not sure what is the common denominator between WSL and MinGW

I am mildly sure. The common denominator between WSL and MinGW is clip.exe.

I can't reproduce the "echo a" game above on 19951. That could be #4637; we'll probably never know. Whatever that was, it is not related to the OP.

@sellithy
Copy link

sellithy commented Mar 5, 2021

Was this issue closed because it was fixed? If so, then it should be reopened because the same thing still happens.

@therealkenc
Copy link
Collaborator

/dupe #4852

@ghost
Copy link

ghost commented Mar 8, 2021

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants