How to paste into a terminal?
Gnome terminal defaults to ControlShiftv
OSX terminal defaults to Commandv. You can also use CommandControlv to paste the text in escaped form.
Windows 7 terminal defaults to CtrlShiftInsert
How to copy and paste in Vim's terminal mode?
Copy
To copy from a terminal window press CTRL-W N (This is a capital N)1 or CTRL-\ CTRL-N (this is not a capital N) to get into normal mode. From there you can use all usual vim commands to copy and paste stuff.
Entering insert mode will drop you back to your shell.
Paste
To paste from a register into the terminal window you have to be in Terminal-Job ("insert") mode.
Press CTRL-W " followed by the register.
:help Terminal-mode
tells us:
When the job is running the contents of the terminal is under control of the
job. That includes the cursor position. Typed keys are sent to the job.
The terminal contents can change at any time. This is called Terminal-Job
mode.Use CTRL-W N (or 'termkey' N) to switch to Terminal-Normal mode. Now the
contents of the terminal window is under control of Vim, the job output is
suspended. CTRL-\ CTRL-N does the same.[...]
In Terminal-Normal mode you can move the cursor around with the usual Vim
commands, Visually mark text, yank text, etc. But you cannot change the
contents of the buffer. The commands that would start insert mode, such as
'i' and 'a', return to Terminal-Job mode.
See :h terminal-typing
for more useful commands in terminal windows.
1Unfortunately the vim help doesn't tell you that it is a capital N, I kept the original notation
Copy Paste in Bash on Ubuntu on Windows
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.
How paste command into WinSCP terminal window?
Righ-click on the Window header → Edit → Paste:
UPD: By the way, if you want to paste it without doing this every time, right-click on the Window header, choose "Properties", enable "QuickEdit Mode", and click "OK". Now you can paste strings with a single "right-click".
How to paste clipboard text in VS Code Terminal
Got answer, link
Right-Click on the cursor line did the trick
How do you copy and paste into Git Bash
Press Insert.
Also, to copy from the window, try clicking the console's window icon (topleft) and choosing Edit -> Mark, then drag a box on the text, then press Enter. (You can also paste via the window icon menu, but the key is faster.)
UPDATE
Starting from Windows 10 the CTRL + C, CTRL + V and a lot of other feature are implemented in conhost.exe so they should work with every console utility on Windows. (You have to enable Properties -> Option tab -> Quick Edit Mode)
Ref: http://blogs.windows.com/buildingapps/2014/10/07/console-improvements-in-the-windows-10-technical-preview/
Windows 10 built-in SSH Client. How to paste the password?
The answers to Copy and Paste in Windows PowerShell (the link given in the other answer by Chris) suggest 5 different ways to paste text. They all work on the plain command line, but only 3 of them work for the ssh password (or when entering any text into the ssh app, such as after you've successfully logged in).
The five are:
- press right-click on the mouse
- use the mouse to open the context menu and click the Edit > Paste option
- hit Ctrl + V on the keyboard
- use the keyboard to access the context menu's Edit > Paste option: Alt + Space, then E, then P
- if the "Use Ctrl+Shift+C/V as Copy/Paste" option is activated, hitting Ctrl + Shift + V on the keyboard
The three that work for ssh are numbers 1, 2 and 5. (As the other answers mention, the ssh login prompt doesn't echo the pasted characters, and you'll need to press Enter after pasting.)
Why don't all 5 methods work?
The tool-tip for the option for number 5 gives a hint as to what's going on.
It says "regardless of input mode". The options dialog also has a new console features link, which has the following:
If you run in processed input mode, the shortcuts below apply, but in
other modes, your application must handle them
(where "shortcuts below" include Ctrl + V)
So I think that ssh runs in a mode other than "processed input mode" (and doesn't itself handle those shortcuts in the expected way) which is what apparently causes methods 3 and 4 to not work.
Copy and Paste in linux terminal
That ultimately depends on your terminal and display server setup (X11 in most cases), but you can try these two things:
- Often you can simply select the text to be copied with your mouse (without pressing any keys) and paste by pressing the middle mouse button (or pressing the scroll wheel).
- If that doesn't work, try selecting with your mouse, then press
SHIFT-CTRL-C
to copy andSHIFT-CTRL-V
to paste. Notice the extraSHIFT
here.CTRL-C
withoutSHIFT
does something else entirely and would send an interrupt signal to the currently running process.
Alternatively, you can use some tool like xclip. E.g. on ubuntu do apt-get install xclip
. Then you can copy to your clipboard, e.g. by doing
echo "Hello World" | xclip
and paste with
xclip -o
>>> Hello World
PowerShell console in Visual Studio Code: How to copy-paste?
Ctrl+C and Ctrl+V for copying / pasting work as-is in Visual Studio Code's integrated terminal.
By contrast, right-click behavior is configurable:
On Windows, the default behavior is to copy, if text is currently selected, and paste otherwise - as in regular console windows.
To get the same behavior as in the Windows PowerShell ISE, i.e. to instead show a shortcut menu, which contains
Copy
andPaste
commands, add the following line to yoursettings.json
file (before the closing}
):
"terminal.integrated.rightClickBehavior": "default",
Alternatively, use the settings GUI (press Ctrl+,):
Note:
The screenshot was taken on macOS, where
selectWord
is the default setting; on Windows, it iscopyPaste
, with the behavior as described above.Also note the GUI's convenient search feature: typing
right click
in the search field was sufficient to locate the relevant setting.
Related Topics
Can Linux Cat Command Be Used for Writing Text to File
How to Show the Wget Progress Bar Only
Indenting Multi-Line Output in a Shell Script
How to Monitor Data on a Serial Port in Linux
How to Install Maven into Red Hat Enterprise Linux 6
"Docker Images" Shows Image, "Docker Rmi" Says "No Such Image" or "Reference Does Not Exist"
In a Linux Shell How to Process Each Line of a Multiline String
Emulating Linux Binaries Under MAC Os X
How to Show a 'Grep' Result with the Complete Path or File Name
How to Delete History of Last 10 Commands in Shell
How to Know Which of the /Dev/Input/Eventx (X=0..7) Have the Linux Input Stream
Linux: Which Process Is Causing "Device Busy" When Doing Umount
Linux Distribution Binary Compatibility
Changing Name of the Video While Downloading via Youtube-Dl
How to List Specific Type of Files in Recursive Directories in Shell
How to Automatically Pipe to Less If the Result Is More Than a Page on My Shell