-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Weird control characters when pasting from windows clipboard to WSL2 #18579
Comments
Interestingly, the .inputrc's
But has not effect in preview:
So, I "fixed" it for myself by reverting from the preview back to normal. UPDATE Unfortunately above settings only fixes pastes to |
Thanks for filing! Can you reproduce the issue with Debug Tap enabled and share the output /? Instructions for how to use Debug tap can be found here: https://github.com/microsoft/terminal/wiki/Troubleshooting-Tips#enabling-the-debug-tap This should help us debug this issue further 😊 |
@carlos-zamora thanks for suggesting! cool troubleshooting method! I hope it will help to understand a problem. So, I prepared a simple json string
Key logger:
Key logger:
Now the same test in the same WSL2 console but using
Logger:
As you can see the VIM is broken here (exactly same WSL2 terminal as above) wsl2.exe provides clean input (right mouse paste) disabling bracketed paste does not work:
what could be the reason? |
Thanks for capturing those! I'm surprised to see that the data is getting yeeted into the input buffer correctly.
Would you mind pasting into I suspect the issue will end up being somewhere in the unchartable middle, in one of our console app API translation layers. |
@DHowett hope it helps, see below. I've been using Windows Terminals without this weird paste issue.
Be aware that above the pasted input is for some reason only correctly shown in the edit mode, I'm cutting it out separately:
|
Windows Terminal version
1.23.10353.0
Windows build number
10.0.19045.0
Other Software
cat, vim 9.0 (inside WSL2)
Steps to reproduce
Since recent time I encounter weird control character pasted before my actuall text, when I try to paste by clipboard into WSL terminal. It is reproduceable in
vim
and with simplecut
:Notice this unexpected characters
^[
at the beginning of the string:cat > test-file.json
Right-mouse paste works fine, no extra characted is inserted:
The behavior is both reproduceable with Ctrl-V and with Ctrl-Shift-V.
I tried to follow the advice of #10572 and put into
.inputrc
lines:but it does not help...
The problem only appears in Windows Terminal, but not in
wsl.exe
for example.The problem does not affect other shells, like PowerShell or CMD.EXE.
Interestingly, if the content is not formatted like
hello world
, it is being pasted withtout weird control character:Does anybody knows what is this problem?
It is very annoying to manually remove this characters from vim buffers manually after every paste...
The text was updated successfully, but these errors were encountered: