How to paste into nano from clipboard?
I have an Ubuntu server hosted by Vultr which I am interacting with remotely using their provided terminal. I would like to know how to paste from my clipboard into nano, which I am using to write the code for my server. I have tried Ctrl+U but this does not work for me.
Other keyboard shortcut commands work, such as write out Ctrl+O and quit Ctrl+X, so I am sure that the Vultr terminal can recognise these keyboard commands.
I'm sure there is a way to paste into nano from the clipboard but I'm not sure what the shortcut is.
Question: What is the keyboard shortcut to paste from clipboard into nano? If there is no way to do this, what native Linux editor is capable?
You could try the following two commands to paste from the clipboard. Both of them should work.
Ctrl+Shift+v
Shift+Insert
The Ctrl+U command only allows pasting text that was copied or cut from within nano itself, hence the reason the command is not working.
Edit:
Unfortunately, for the specific case when using Vultr console, there seems to be no easy way of using copy and paste. Vultr simply does not support it. An alternative would be to use SSH together with another terminal to connect to the server. If you are on Windows, using putty would work.
SSH Putty windows Shift+right mouse click worked for me with default putty settings.
I successfully used right mouse button to paste from Windows 10 to nano on "Bash on Ubuntu on Windows".
nano itself has no system clipboard integration; it is dependent on the terminal's clipboard handling for interacting with it.
From the Vultr documentation:
Notes about console: The console software does not support cut & paste.
If you want clipboard handling as given in the question then you will have to use a SSH program and terminal that supports it.
If there is no way to do this, what native Linux editor is capable?
I'm not sure if Nano actually can do this more or less natively without explicit support from the terminal, but you may want to use X11-enabled Vim over an X11-forwarded session (ssh -X
). Then "+y
command will yank ("copy") to the X11 clipboard, and "+p
will put ("paste") from there — without the need for terminal to support this.
Note that X11-enabled Vim doesn't mean GUI version (gVim). Console Vim can remain in the terminal, but is still able to access X11 clipboard thanks to being linked with X11 libraries. It just has to know your (forwarded) DISPLAY
.