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 ^V into 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)

Most upvoted comments

Ctrl+V doesn’t do anything in WLS.

And yet …

2018-10-23 10_42_16-greenshot

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,

  • Ctrl+Shift+V is different from Command Prompt, so that’s undesirable. It would be the same as on most Linux distros, but who cares! It currently inserts ^V into the shell, which is weird but some tool might do something with it, who knows.
  • Ctrl+V is the standard, not only in Command Prompt, but also in EVERY other application. Currently it inserts ^V into the shell when hitting Ctrl+V twice, but a single Ctrl+C does absolutely nothing.
  • Right mouse click is okay, because it has always worked. Please keep that intact.

To aid users who desperately want Ctrl+Shift+V to paste, let’s implement both Ctrl+Shift+V AND Ctrl+V.

@therealkenc

Paste does not insert anything into WSL; essentially, or otherwise.

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.

Of course Mike isn’t inserting anything into my console.

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 NOT work in WSL.

Ctrl+V does work in WSL (strictly speaking, /bin/bash). bash invokes literal next if that’s the stty setting.

ken@DESKTOP-4UTIQSF:~$ stty -a | grep lnext
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;

but that magical layer in between all of them: WSL

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 0x16 unmolested. ConPTY doesn’t know what the Windows Console is doing about paste operations either.

Now please stop arguing about what WSL is or isn’t

You perceive an argument where none exists. This WSL tracker has been closed since February.

Okay. So instead of sending 0x16, [it could] send all characters in the clipboard?.. Doesn’t seem like rocket science to me.

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.

accept that paste just doesn’t bloody work on WSL

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.