16

This is just one of those things that I started wondering about.

Why aren't the copy/paste keyboard shortcuts (that we all love) in command prompt not aligned with the rest of the software population? I understand that it could be that historically ctrl+c and ctrl+v had different meanings in shell programs. But isn't it high time someone changed this?

Powershell was actually designed in the new century but still doesn't support ctrl+v.

Is it because windows doesn't want to break all the legacy scripts that may have assigned different uses for ctrl+v ? If that's the case, why does every major upgrade to the .Net framework deprecate some star feature from the previous version.

Everytime I do a ctrl+v on command prompt I think to my self that there must be a real good reason for things to be the way they are. I'm hoping someone would be able to tell me what it is.

Nandun
  • 333
  • 3
  • 6
  • 10
    This can't really be answered by anyone except the powershell design team. I can point out though that if you were to implement CTRL-v as paste then you would really need to implement CTRL-c as copy. Which would remove it as the key combination to stop execution of a command. It has been that for far longer than it has been copy. – EBGreen Nov 13 '13 at 21:54
  • 1
    They did make it a lot easier in a `cmd.exe` to paste with just a right-click **anywhere** in the window. It used to be (Windows XP) that you had to right-click in the title-bar, choose `Edit` and then `Paste` (3 clicks). BTW You could make this yourself with AutoHotkey and mapping to `Alt+Space`, `E` and `P`. – Rik Nov 13 '13 at 22:33
  • I will add that what I want is a powershell shell that understands Vi. – EBGreen Nov 13 '13 at 22:49
  • @EBGreen - I understand your point about ctrl+c. It was used to interrupt execution for the longest time. but its used to "copy" far more often in modern software. – Nandun Nov 13 '13 at 23:28
  • 3
    @Rik I'm aware of all those methods. But you have to understand that if your job requires you to copy/paste stuff on cmd ALOT, it can get pretty annoying. – Nandun Nov 13 '13 at 23:30
  • 2
    If you have to copy/paste stuff in Command Prompt a lot, why don’t you just learn to right-click? (You do know about QuickEdit mode, right?) – Scott - Слава Україні Nov 14 '13 at 00:06
  • 4
    Try getting used Ctrl-Insert to copy, Shift-Insert to paste (Shift-Del to cut). Those don't conflict with other uses, as Ctrl-C and Ctrl-V do. – Gabe Nov 14 '13 at 01:42
  • 1
    Isn't the usage of Ctrl-C and Ctrl-V for Copy and Paste respectively only in the GUI land? Since you are working in CLI land they have their own rules. – Darius Nov 14 '13 at 04:30
  • 1
    See http://www.github.com/lzybkr/PSReadline - it supports Ctrl+V to paste from the Windows clipboard. There is Emacs like kill ring support which is similar to the clipboard, but PSReadline does not yet cut/copy anything to the Windows clipboard. – Jason Shirk Nov 27 '13 at 22:32
  • In the linux terminal, ctrl+shift+v will paste. – Matthijs Wessels Jan 12 '15 at 13:23
  • It is your terminals fault. Try https://code.google.com/p/conemu-maximus5/ instead and you'll find that even ctrl+v has been outdated on modern terminals. Linux has been using better copy\paste schemes in their terminals since the beginning. – krowe2 Jan 13 '15 at 21:26
  • Linux terminals don't support ctrl+C and ctrl+V for copy and paste either, and you must use ctrl+shift+C/V instead. In the new command prompt in Windows 10 you can choose to copy/paste with ctrl+C and ctrl+V but this is still experimental – phuclv Jan 18 '15 at 12:21
  • Because Powershell uses the console host for its window. It's the job of the console host to handle (and implement) copy & paste, not Powershell's. Because the console host was changed in Windows 10 to support CTRL-V/-X/-C, these shortcuts now not only work for cmd.exe but for for Powershell as well. – Simon Jan 26 '15 at 09:40
  • @EBGreen not necessarily; you can implement Ctrl+V for paste (always) and Ctrl+C as copy (*only when a block is mouse-selected*) - this way, as long as you don't select any text with mouse, regular Ctrl+C for breaking is maintained (not to mention you should rather Ctrl+Break for that AFAIR due to the way keyboard interrupt works) –  Jan 02 '16 at 18:50
  • 1
    also, funny note: http://superuser.com/questions/421463/why-does-ctrl-v-not-paste-in-bash-linux-shell (essentially the same question as this, but about *n*x) got more than 100 upvotes and tons of answers... and it *didn't* get closed, btw. –  Jan 02 '16 at 18:54

0 Answers0