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:23

To get right-click to paste to work:

  • Right-click on the title bar > Properties
  • Options tab > Edit options > enable QuickEdit Mode

enter image description here

查看更多
爷的心禁止访问
3楼-- · 2020-02-07 16:24

Ok, it's developed finally and now you are able to use Ctrl+Shift+C/V to Copy/Paste as of Windows 10 Insider build #17643.

You'll need to enable the "Use Ctrl+Shift+C/V as Copy/Paste" option in the Console "Options" properties page:

enter image description here

referenced in blogs.msdn.microsoft.com/

查看更多
贼婆χ
4楼-- · 2020-02-07 16:25

Alternate solution over here, my windows home version Windows Subsystem Linux terminal doesn't have the property to use Shift+Ctrl (C|V)

Use an actual linux terminal![enter image description here]1

  • Install an X-server in Windows (like X-Ming)
  • sudo apt install <your_favorite_terminal>
  • export DISPLAY=:0
  • fire your terminal app, I tested with xfce4-terminal and gnome-terminal

windows #ubuntu #development

查看更多
贼婆χ
5楼-- · 2020-02-07 16:26

Edit / Paste from the title bar's context menu (until they fix the control key shortcuts)

查看更多
乱世女痞
6楼-- · 2020-02-07 16:28

Update 2019/04/16: It seems copy/paste is now officially supported in Windows build >= 17643. Take a look at Rich Turner's answer. This can be enabled through the same settings menu described below by clicking the checkbox next to "Use Ctrl+Shift+C/V as Copy/Paste".


Another solution would be to enable "QuickEdit Mode" and then you can paste by right-clicking in the terminal.

To enable QuickEdit Mode, right-click on the toolbar (or simply click on the icon in the upper left corner), select Properties, and in the the Options tab, click the checkbox next to QuickEdit Mode.

With this mode enabled, you can also copy text in the terminal by clicking and dragging. Once a selection is made, you can press Enter or right-click to copy.

查看更多
Rolldiameter
7楼-- · 2020-02-07 16:28

You can use AutoHotkey (third party application), the command below is good with plain alphanumeric text, however some other characters like =^"%#! are mistyped in console like bash or cmd. (In any non-console window this command works fine with all characters.)

^+v::SendRaw %clipboard%
查看更多
登录 后发表回答