How can I paste from the clipboard? - shell

Google cloud shell isn't letting me 'paste' what is in my clipboard.
I have tried using the 'send command' ctrl+v option, as well as tried with root.
I found it works with IE! Gives a message to allow clipboard access to the page (but a one time thing).
What am I missing?
Turns out this is not Chrome but my system settings. I tried on a different system and it worked!

For me, it does not work on Firefox version 60.2 on Linux (openSuSE Leap 15). But it works on Chromium 69.0.3497.100 (open SUSE Build) 64 bits. I believe it will also work with Google Chrome.
Very important!!! Ctrl + v does not work! You must use Ctrl + Shift + v to paste to Google Cloud Shell using Chromium.
Note 1: Ctrl + Shift + v did not work for me in Firefox
Note 2: I found a config option on top left of cloud shell frame, in the shape of a tool. There you can select Terminal Preferences > Copy configuration and will be an option to select Copy and Paste with Ctrl+Shift+C/V. Try enabling it if Ctrl + Shift + v does not work for you.
Note 3: Shift + Insert works for me on Chromium, but not on Firefox.
In Firefox with this enabled or disabled copy and paste does not work. On Chromium it worked with this option enabled and disabled.

Use Shift+Insert instead of Ctrl+V.

I have a Firefox and had the same problem with Google Cloud Shell. I tried Ctrl+V, Ctrl+Shift+V, Shift > Right Click > Paste and Terminal Preferences > Copy Configuration > Copy and Paste with Ctrl+Shift+C/V.
It turned out the problem was connected with security settings of my Firefox. The option dom.event.clipboardevents.enabled had to be set back to default true.

ctrl+c and ctrl+v will work. Simple!!!

Turns out this is not even chrome buy my system settings. I tried on a different system and it worked with even Chrome!

Related

How to make this work with Chrome on MAC: using shortcut key to do CMDs in menu

I am new to MAC. Before this, PC user.
On PC, Chrome, I can do this:
Copy an url somewhere.
Go to Chrome, move mouse to the address bar.
Right click.
Press 'D' on keyboard.
Now chrome go to the url U Copied. My point is, we no need to Paste and hit enter key anymore. This is way faster and convenient. Not just 'Paste and go', also 'Paste and search' etc.
But, mac seems does not support this, any ideas?
I don't see any way to add the "D" shortcut to the "Paste and Go" contextual menu.
However, you should try Alfred
Once installed, press alt+space
Then just paste your link and it will open:
Or enter the terms you want to search:
It's fast and convenient. (no need to right-click into the Chrome address bar)
I'm on macOS Mojave 10.14.2 and using Chrome Version 71.0.3578.98 (Official Build) (64-bit)
If I copy an URL then I'm getting an option as Paster and Go
If I copy some random text (not an URL) I'm getting an option as Paster and Search.
This is working out of the box. No need to do anything!!

How do I paste from PuTTY into Vim 8.0?

Scenario
From a Windows 10 Anniversary Update client ...
Open a web browser, copy / paste some text from a website (eg. GitHub)
Use PuTTY 0.67 to SSH to a Linux VM (eg. Ubuntu 16 Xenial Xerus)
Open a file in Vim
Hit i to change into Insert mode
Right-click to paste the clipboard contents
Issue
Unfortunately, when I right-click in the PuTTY session, rather than pasting clipboard contents, what's actually happening is that Vim is going from INSERT mode to (insert) VISUAL mode. I don't think I've ever seen anything like this before.
Question
Does anyone know why this is happening, and how I can paste my Windows client clipboard into the SSH / Vim session?
It appears that this issue is due to a change in defaults for VIM version 8.0 and higher.
Previous versions had mouse mode turned off (mouse=), but the new default is mouse mode turned on (mouse=a).
There are 3 ways to deal with this situation:
Adapt to it: With mouse mode turned on, the new way to paste is shift-right-click (at least in PuTTY)
Change it: You can turn off mouse mode for your current VIM session by typing :set mouse= and <enter>
Revert it: You can override the new defaults by calling VIM with the "C" switch (vim -C {filename}) and it will revert back to the Vi "compatible" settings for that session
Of course you can always add set mouse= to your .vimrc file to make it permanent. But that doesn't work for me because I hop around on too many different systems.
I solved this problem by turning off mouse mode.
:set mouse=
I faced the same problem
You just need to change in the vmrc file
vim $HOME/.vimrc
set the following in the file
set mouse-=a to .vimrc
It worked fine

Copy Paste in Bash on Ubuntu on Windows

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?
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
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.
Thanks for your patience while we re-engineered Console's internals to allow this feature to work :)
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%
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+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:
Copy options:
Paste options:
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:
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!
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 :-(
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]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
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.
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 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.

Why is my Ctrl-key disabled in iTerm.app?

I'm trying to use the new iTerm app on my Snow Leopard Mac, but my Ctrl seems to be completely dead (as in non-responsive, as in nothing happens when I type Ctrl+a except for an outputed 'a') and I haven't found anything useful while googling. The closest match was this thread here on stackoverflow, but everything in Terminal.app works as it should.
And, even more strange - I can Ctrl+z myself out of applications, but I can't save files in Emacs (C-x C-s) or any other keyboard shortcuts that uses a Ctrl shortcut. And it's not local, since Ctrl is as broken on my iMac as it is on other unix computers I've sshed onto with iTerm. I've tried both in bash and zsh.
I've tried to remove all files concerning iTerm.app in my ~/Library/Application Support, and I've tried the very latest version (currently 13 h old) of iTerm I could lay my hands on, but to no avail.
Any ideas?
This seems to be an iTerm bug.
You can work around it by creating a key mapping in the profile settings.
Add a mapping for ^x so it sends 0x18 (which is the encoded form of ctrl+x).
I suggest to check this post to see if the ctrl key is enabled in your preferences
https://apple.stackexchange.com/questions/52041/how-to-press-control-key-on-mac
Did you try to configure key bindings for this terminal emulator as specified in the iTerm wiki:
http://code.google.com/p/iterm2/wiki/Keybindings
at last, have you try set -o emacs or set -o vi?
If it works, set it in your ~/.bashrc to run it at login.

Is there a Firefox keyboard shortcut to clear the cache?

With the Firefox web developer toolbar I can select "Miscellaneous → Clear private data → Cache". Is there a way to do the same with a keyboard shortcut?
Edit: I am also using vimperator to drive Firefox with the keyboard; just found out that it's possible using: :emenu Extra.Web Developer.Miscellaneous.Clear Private Data.Cache.
I think Ctrl+Shift+Delete takes out all private data, including the cache. Heres a link that'll tell you how to set up specific options.
You can also reload and clear cache for a certain page with
Cmd + Shift + R
on a mac, or
Ctrl + F5
on a windows/linux machine.
(these are additions to the plain reload shortcuts Cmd+R / F5)
I use the web developer add-on to totally disable my cache on my development machine. That way you never have to worry about clearing your cache.
In Firefox is
CTRL + SHIFT + R
Source
For Mac OSX it is
Command + Shift + Delete
for all browsers (except Safari)
I guess
Ctrl + Shift + Delete
is not what you want?
You can try this combination:
ctrl + F5
What I do is go to
Tools > Options > Privacy > Show Cookies
then just keep the Show Cookies window open.
It stays minimized while on your web page so you just have to hit
Maximize > Remove All cookies

Resources