52

On the new Windows 10 insider build 14316, I haven't been able to use Ctrl + V (shortcut for paste) on the new Bash on Ubunbu on Windows app. Has anybody else had this issue? Any solutions?

I have edited the app's properties to enable control shortcuts and insert. Also, I have tried Ctrl + Shift + V and Shift + Insert and neither work.

Sergei Wallace
  • 2,829
  • 5
  • 16
  • 18
  • 1
    Does Ctrl+Shift+V work? That's what the shortcut is in many Linux terminals. Otherwise, I seem to remember that middle click pastes in cmd (but I don't know for sure). – tanner Apr 13 '16 at 03:58
  • Ctrl + Shift + v doesn't work either. And I don't have a middle click. – Sergei Wallace Apr 13 '16 at 03:59
  • if the original bash doesn't support if, Windows 10 will also not support it. Does it work in a real Ubuntu? – magicandre1981 Apr 13 '16 at 04:33
  • 1
    I don't know, I've never used the real Ubuntu. I have Windows, and hence was thrilled when the announced that they would have Bash. It just sucks not being able to copy and paste quickly. They support it for the command prompt though, so maybe they just haven't added it for their bash shell yet, or forgot. Or it's a bug, idk. – Sergei Wallace Apr 13 '16 at 05:17
  • [This question](http://superuser.com/q/421463/820) may explain why. Remember, you are essentially running Linux, so it will behave differently than you may expect if you're only used to how Windows works. – heavyd Apr 13 '16 at 05:47
  • They just suggest shift + insert or Ctrl + Shift + v. Neither of those work for me though. Have you tried it? Any of it work for you? – Sergei Wallace Apr 16 '16 at 18:35
  • Does clicking the window's icon (in the upper-left) produce a menu with Edit as one of its submenus? If so, Paste might be an option there. – Ben N Apr 16 '16 at 18:51
  • Yeah, that works. Is there a shortcut for that? Or a way to make a shortcut? – Sergei Wallace Apr 16 '16 at 18:55
  • What's interesting is that I can't paste from edit initially upon opening the Bash app. It's grayed out and only copy is available. Only when I do Ctrl + V (which just types ^V) can I access the paste option. – Sergei Wallace Apr 16 '16 at 19:10
  • There's an issue open for this problem here, it seems it will be fixed in a future release: https://github.com/Microsoft/BashOnWindows/issues/1471 –  May 04 '17 at 00:18
  • @SergeiWallace the [feature is now part of 1809 update](https://superuser.com/a/1319874/174557) – magicandre1981 Feb 07 '19 at 15:28
  • The current best answer is down below (https://superuser.com/a/1319874/551544). This is one of the cases where SO's voting mechanism is not keeping pace. – dreua Mar 21 '19 at 22:46

6 Answers6

44

Why don't you guys just Right Click? here is how to enable copy and paste:

  1. Go to the top of the bash window, right click, go to properties
  2. Check the box that says Quick edit Mode, and you are set!

    Copy and Paste Enabling on Bash for Windows 10

Good day!

-- Activate Quick Edit mode, then mouse left-click is select text, right DOUBLE-click is PASTE

Ozl
  • 622
  • 6
  • 6
  • 10
    Helpful but I would say that "QuickEdit Mode" is not a hugely transparent label for saying "allow right click paste" so not surprising it was missed. – Nate Sep 28 '16 at 09:45
  • 29
    My reason for not right clicking is simple: I don't want to move my hand to the mouse if I can avoid it. Keyboard shortcuts exist for a reason, and should be maintained across the platform (I don't really care _what_ the shortcut is for copy&paste, as long as there is one). – Jed Daniels Jan 11 '17 at 18:28
  • FWIW, for me, right SINGLE-click is paste – Michael Feb 08 '17 at 04:55
  • 8
    Right click is not ctrl+v... – nicowernli Mar 01 '17 at 21:47
  • enabling Ctrl key didn't solve the problem for me :( – amigo421 May 30 '17 at 07:46
  • Doesn't work for pasting in SSH password. – Calvin Fisher Jun 06 '17 at 12:38
  • 3
    Doesn't work for me even though my settings were already set up as in the screenshot. Asking why don't we just right click is kind of annoying. The question was about getting the keyboard shortcut working -- you're saying why not just not use the keyboard :-[ – jcollum Jun 28 '17 at 15:07
  • 8
    This is not a real solution to the issue. – Zoey Jul 01 '17 at 22:36
  • 2
    Why is this marked the answer when it doesn't answer the specific question about keyboard shortcut ctrl+v? – Manachi Sep 12 '17 at 07:41
  • @Zoey I posted the [real solution](https://superuser.com/a/1319874/174557) that works since Win10 1809 – magicandre1981 Mar 19 '19 at 15:38
11

The main issue, I believe, is that cmd.exe isn't dealing well with the bash environment. By itself the new cmd.exe actually does support Ctrl+v but whilst running bash, it doesn't.

My workaround is to use ConEmu. It's much superior to cmd.exe alone and even gives you color highlighting when running bash. I've tested it and Ctrl+v does work. As a nice plus, you get a tabbed terminal.

techraf
  • 4,852
  • 11
  • 24
  • 40
Tiago Espinha
  • 210
  • 1
  • 7
  • 1
    I downloaded it. How do I configure Bash to use ConEmu instead of the normal command prompt? – Sergei Wallace Apr 17 '16 at 16:01
  • ConEmu is sort of a wrapper around cmd.exe. Just by running the plain cmd.exe within ConEmu should allow you to paste by using CTRL+V. – Tiago Espinha Apr 18 '16 at 08:56
  • @spwallace if you've installed bash before ConEmu, the first time you start ConEmu (which I am doing right at this very moment) the fast configuration offers to "Choose your startup task or even a shell with arguments" and bash is there. But also once you started ConEmu, the green plus menu besides the search bar also offers all sorts of shells. – chx May 05 '17 at 01:01
  • ConEmu solved the Ubuntu Bash "Ctrl + V" problem for and a nice thing is that ConEmu is Open Source Software (BSD license). Plus it fixes the awful "directory path blue" that is just unreadable on black background. – Alex Jul 15 '17 at 12:29
  • Thank you. I've installed ConEmu and it's looking great so far. – Manachi Sep 12 '17 at 07:47
6

Starting with at least Windows 10 Insider build 17643, you can use Ctrl+Shift+C/V as Copy/Paste if you enable it in the bash options:

enter image description here

This feature is part of the October 2018 Update (1809 - Build 17763).

magicandre1981
  • 97,301
  • 30
  • 179
  • 245
5

As far as I know there's no 'good' solution out there (quickedit paste doesn't seem to work).What I would suggest is this: create an autohotkey script:

SetTitleMatchMode, 2
#IfWinActive, bash
^v::
SendInput {Raw}%clipboard%
return
mgrant24601
  • 51
  • 1
  • 2
  • 1
    I have ConEmu running but I do not want to use Ctrl + V because that's used by `nano` so I used `+^v::`. Also, since ConEmu doesn't always have bash in the window, I used `#IfWinActive ahk_exe ConEmu64.exe` – chx May 14 '17 at 06:54
3

As we figured out in the comments, the Paste entry in the window's system menu only activates after pressing Ctrl+V once, which is unusual. After that, though, you can use the sequence Alt+Space, E, P. (Courtesy of this Stack Overflow answer by Nescio.) That's not optimal, but it works.

If the Bash on Ubuntu on Windows window has a Properties entry in that menu, you might be able to check the "QuickEdit Mode" box on the Options tab to allow right-clicking in the window to count as a paste.

Ben N
  • 40,045
  • 17
  • 140
  • 181
0

The problem is not specific to "BASH on Ubuntu". All Windows commandline windows experience this including cmd and powershell. Access the window menu under the icon in the top left (another answer mentioned alt+space, this opens the window menu). Choose defaults. Enable QuickEdit mode.

By default, in QuickEdit mode, highlighting copies and right click pastes. (Before Win 10, it still doesn't get you ctrl+c and ctrl+v).

Jeter-work
  • 523
  • 2
  • 9