Copy Paste in Bash on Ubuntu on Windows

2020-02-07 15:33发布

How to execute a copy paste operation from Windows 10 to the Bash on Ubuntu on Windows environment?

I tried the following:

  • ctrl + shift + v
  • right click to paste

Any suggestions?

13条回答
祖国的老花朵
2楼-- · 2020-02-07 16:10

That turned out to be pretty simple. I've got it occasionally. To paste a text you simply need to right mouse button click anywhere in terminal window.

查看更多
看我几分像从前
3楼-- · 2020-02-07 16:13

Like it has been written before:

  • Right Click on Bash on Ubuntu on Windows Icon if you have it on a Task Bar Shortcut Icon
  • Click on Properties
  • Select Options Tab on the Properties Window
  • Check the QuickEditMode option
  • Click Apply

Now you are able to open a new Bash Terminal and just use Right-Click to paste

In order to be able to copy from Terminal, Just use CTRL+M and this will enable you to select and copy selected Text.

查看更多
可以哭但决不认输i
4楼-- · 2020-02-07 16:13

For just copying (possibly long) texts to the Windows clipboard, I have found that just piping the output to clip.exe (including the .exe file extension) works fine for me. So:

$ echo "Hello World" | clip.exe

lets me paste Hello World using Ctrl-V anywhere else.

Now that I have posted this, I notice that related question Pipe from clipboard in linux subsytem for windows includes this and a command solution for pasting from the Windows clipboard as well.

查看更多
看我几分像从前
5楼-- · 2020-02-07 16:16

you might have bash but it is still a windows window manager. Highlite some text in the bash terminal window. Right click on the title bar, select "Edit", select "Copy", Now Right Click again on the Title bar, select "Edit" , Select "Paste", Done. You should be able to Highlite text, hit "Enter" then Control V but this seems to be broken

查看更多
劳资没心,怎么记你
6楼-- · 2020-02-07 16:19

At long last, we're excited to announce that we FINALLY implemented copy and paste support for Linux/WSL instances in Windows Console via CTRL + SHIFT + [C|V]!

You can enable/disable this feature in case you find a keyboard collision with a command-line app, but this should start working when you install and run any Win10 builds >= 17643.

New Console Properties showing CTRL + SHIFT + C/V option

Thanks for your patience while we re-engineered Console's internals to allow this feature to work :)

查看更多
不美不萌又怎样
7楼-- · 2020-02-07 16:22

As others have said, there is now an option for Ctrl+Shf+Vfor paste in Windows 10 Insider build #17643.

Unfortunately this isn't in my muscle memory and as a user of TTY terminals I'd like to use Shf+Ins as I do on all the Linux boxes I connect to.

This is possible on Windows 10 if you install ConEmu which wraps the terminal in a new GUI and allows Shf+Ins for paste. It also allows you to tweak the behaviour in the Properties.

The Console looks like this:ConEmu Console

Copy options:ConEmu Copy properties

Paste options:ConEmu Paste properties

Shf+Ins works out of the box. I can't remember if you need to configure bash as one of the shells it uses but if you do, here is the task properties to add it:ConEmu Bash Task Properties

Also allows tabbed Consoles (including different types, cmd.exe, powershell etc). I've been using this since early Windows 7 and in those days it made the command line on Windows usable!

查看更多
登录 后发表回答