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?
clip.exe
, e.g. echo "Blah blah blah" | clip.exe
.
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 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.
To get right-click to paste to work:
Right-click on the title bar > Properties
Options tab > Edit options > enable QuickEdit Mode
https://i.stack.imgur.com/0r1aZ.png
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:
https://i.stack.imgur.com/rVeTm.png
referenced in blogs.msdn.microsoft.com/
winver
@methodsignature
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. Select "Properties" from the menu to access the following dialog box.
https://i.stack.imgur.com/K6Dsg.png
Thanks for your patience while we re-engineered Console's internals to allow this feature to work :)
winver
from the run dialog or command-line. To get early access to these and other features as they're being built, you'll need to sign up for the Windows Insider Program; details here: insider.windows.com/en-us
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%
^#v
as Ctrl+Shift+V
, but it did not work because ^#v
stands for Ctrl+WinKey+V
. You should use ^+v
, which stands for Ctrl+Shift+V
.
+Ins
because ^+v
collides with any program already using that for other purposes in some contexts like nano "jump to last line". I have yet to find anything using shift+insert for different purposes.
^+v::SendInput %clipboard%
/
chart to |
so paths /a/b/c
turns into |a|b|c
Right-click the title bar, select context menu Edit -> Paste (until they fix the control key shortcuts)
As others have said, there is now an option for Ctrl+Shf+V
for 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.
https://i.stack.imgur.com/LDcJp.png
https://i.stack.imgur.com/W9Zm3.png
https://i.stack.imgur.com/pnd6B.png
https://i.stack.imgur.com/VyXqX.png
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!
Shift+Ins
for paste without even messing with the settings. Plus, I am excited to check out the app for what else it offers.
Shf+Ins
is not going to be available in build 17643 - Just Shf+Ctrl+V
. I use Shf+Ins
every day so didn't want to learn an alternative key press.
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.
For pasting into Vim in the terminal (bash on ubuntu on windows):
export DISPLAY=localhost:0.0
Not sure how to copy from Vim though :-(
DISPLAY
has absolutely nothing to do with vim
or copy and pasting.
Alternate solution over here, my windows home version Windows Subsystem Linux terminal doesn't have the property to use Shift+Ctrl (C|V)
https://i.stack.imgur.com/bCJ7D.png
Install an X-server in Windows (like X-Ming)
sudo apt install
export DISPLAY=:0
fire your terminal app, I tested with xfce4-terminal and gnome-terminal
windows #ubuntu #development
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
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.
For autohotkey users, a full answer is:
#IfWinActive ahk_class ConsoleWindowClass
^+v::SendInput %clipboard%
Which checks that you're in a console (windows or ubuntu) before pasting from the windows clipboard.
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.
Success story sharing