WSL: Ctrl+V not working
-
Your Windows build number: 10.0.16299.214
-
Bash version: 4.3.48(1)-release-(x86_64-pc-linux-gnu)
-
“Kernel” version: 4.4.0-43-Microsoft
-
What you’re doing and what’s happening: Trying to paste text into the console, but all I’m getting is
^V, which is probably some archaic escape character that noone needs anymore. -
What’s wrong / what should be happening instead: Pressing Ctrl+V inserts
^Vinto the terminal, rather than copied text. Same for Ctrl+Shift+V and Ctrl+Ins. Only the right mouse button successfully pastes text. I would expect Ctrl+V to just paste the copied text, just like in the regular command prompt (cmd.exe) where it works totally fine. -
Strace of the failing command, if applicable: N/A
My settings in Alt+Space->Properties are default, afaik. But to be clear: QuickEdit Mode: ticked Insert Mode: unticked Enable Ctrl key shortcuts: ticked Filter clipboard contents on paste: ticked Enable line wrapping selection: ticked Extended text selection keys: ticked Use legacy console: unticked
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 5
- Comments: 36 (3 by maintainers)
And yet …
No difference.
Ctrl+V does paste in command prompt, but does not paste in WSL. Ctrl+Shift+V does not paste in either.
All on the same pc, same network, same user, same day, same moon phase.
Either way, I would like Ctrl+V to execute paste. For me, having Ctrl+Shift+V is wasted effort, because my muscle memory is hard-wired to Ctrl+V and has been for several decades.
So a checkbox like “Ctrl+V means paste but it breaks that one obscure terminal program that uses 0x16 control codes to do something uninteresting” with a big fat tick, would do it for me 😃
That’s nice. So displaying Ctrl-V as shortcut for paste is a feature, even though that’s not the shortcut that was implemented? #JustMicrosoftThings
That’s even weirder. At least the menu is on the right track. Maybe Ctrl+V doesn’t work because in the menu it says “Ctrl minus V” 😀
Anyway,
^Vinto the shell, which is weird but some tool might do something with it, who knows.^Vinto the shell when hitting Ctrl+V twice, but a single Ctrl+C does absolutely nothing.To aid users who desperately want Ctrl+Shift+V to paste, let’s implement both Ctrl+Shift+V AND Ctrl+V.
@therealkenc
Maybe you’re misunderstand my point there.
Clearly it does something when rightclicking the terminal. It inserts the contents of the clipboard. It does, really. It definitely inserts something. Whether it does that by “typing” I don’t know, but afaik this is how most terminals work - including Windows’ command prompt & powershell, macOS’ terminal, Ubuntu’s terminal, etc. They somehow inject “typing”, which can easily be proved by pasting characters that control a program in some way.
I understood you. In your context you meant Mike when you said ‘they [the coders] inject typing [by way of their implementation]’, and I had already given you a hard time about pronouns. Plus Mike and the rest of the Console team did an amazing job so I wanted to give credit where credit was due.
Ctrl+V does work in WSL (strictly speaking,
/bin/bash).bashinvokes literal next if that’s the stty setting.The layer in between the Windows Console and the WSL kernel is pretty magical, I’ll give you that. But ConPTY just passes on the
0x16unmolested. ConPTY doesn’t know what the Windows Console is doing about paste operations either.You perceive an argument where none exists. This WSL tracker has been closed since February.
Yes, it (the Windows Console) could do that. Wouldn’t be rocket science. They (by which I mean Mike) won’t, of course, to quoth “ensure that we [Rich means the Console team] don’t break any existing behaviors”.
In fact it was pretty tricky (maybe not rocket science but definitely computer science) for the Console team to change their paste behavior to Ctrl+Shift+V without breaking existing Powershell behavior or break existing Linux/Unix behavior. Or prevent Ctrl+V from being incongruous with Ctrl+C. Quite a feat really. Which is probably why it took two years.
Paste works in WSL. It just has a different keyboard shortcut. This is because of Reasons™.
Ctrl+V doesn’t do anything in WLS.
Besides, consistency is more important than legacy. It’ll only be confusing if we’ve got mixed shortcut keys for the same action is VERY similar terminals (cmd vs wls).
Also I didn’t say anything about Ctrl+C. I know that one means “break”, just and in cmd. Selecting with mouse and hitting Enter is a perfectly sane way to copy text. Already works btw. It’s the same between cmd and wls, which is a good thing to have.
@DarthSpock Ctrl+V works fine in the regular command prompt. So there is some sort of different between it and the WSL console. I wouldn’t file a bug like this at the Windows Console, because it’s working fine. It’s only broken for the WSL terminal. This indicates a bug inside WSL, where maybe Ctrl+V is overridden with whatever.