A clipboard is a temporary storage, mostly related to text, from where contents can be pasted to a new/other location. Use this tag for questions that specifically involve problems with putting material in, or getting material out of the clipboard
Questions tagged [clipboard]
426 questions
148
votes
6 answers
Why does Vim indent pasted code incorrectly?
In Vim, if I paste this script:
#!/bin/sh
VAR=1
while ((VAR < 10))
do
echo "VAR1 is now $VAR"
((VAR = VAR +2))
done
echo "finish"
I get these strange results:
#!/bin/sh
#VAR=1
#while ((VAR < 10))
# do
# …
elbarna
- 12,050
- 22
- 92
- 170
133
votes
17 answers
Getting tmux to copy a buffer to the clipboard
I am trying to figure out a decent way to copy what I have in a tmux buffer into my clipboard. I have tried a couple of different things like
bind-key p select-pane -t 2 \; split-window 'xsel -i -b' \; paste-buffer
which gets me fairly close, all…
Digital Powers
- 1,817
- 4
- 14
- 11
127
votes
12 answers
How to copy text from vim to an external program?
I'm trying to copy-paste some text from vim. I'm doing v to enter visual mode, then y once I selected my block.
It appears to copy the text into vim's clipboard, because p will paste it.
But in another program (e.g. Chrome), right-click->paste…
ripper234
- 31,063
- 43
- 82
- 90
115
votes
6 answers
How to copy and paste with a mouse with tmux
I'm using tmux and OSX. When copying and pasting from the terminal with tmux I'm able to hold down Option and select text. However I can't get the text to stay inside the pane. So when I want to copy text I either need to cycle the pane to the far…
mbigras
- 2,928
- 6
- 28
- 45
114
votes
2 answers
Is Vim immune to copy-paste attack?
You should never paste from web to your terminal. Instead, you should paste to your text editor, check the command and then paste to the terminal.
That's OK, but what if Vim is my text editor? Could one forge a content that switches Vim to command…
Adam Trhon
- 1,623
- 3
- 17
- 20
83
votes
4 answers
Copy file to xclip and paste to Firefox
I'm coping file to xclip
cat file.txt | xclip
I'm pasting without problem with
xclip -o
When I want to paste it to Firefox with Ctrl+V it pastes old text (that shouldn't already be in the clipboard).
When I go back to terminal and run xclip -o it…
xralf
- 16,149
- 29
- 101
- 149
77
votes
12 answers
Copy-paste for vim is not working when mouse (:set mouse=a) is on?
I was trying to copy paste something from vim to another application and also, from that application to vim using right click with mouse and then copy and paste (or with Ctrl+v and Ctrl+c and also tried the Command version for mac OSX, obviously.).…
Charlie Parker
- 1,497
- 3
- 16
- 28
73
votes
2 answers
Copy image from clipboard to file
Is it possible to take an image from the clipboard and output it to a file (using X)?
I can do this with text easily:
$ xclip -selection c -o > file.text
But when I try the above with an image nothing is written.
The reason I want to do this is I…
Lerp
- 863
- 1
- 7
- 6
58
votes
8 answers
How do I send stdout to the clipboard?
Is there functionality in Unix that allows for the following:
echo "Some Text" | copy-to-clipboard
Stefan
- 24,830
- 40
- 98
- 126
52
votes
5 answers
Copy selection to a clipboard in tmux
If I select text with a mouse in tmux in iTerm2 on macOS I get the selected text copied into my clipboard. I do not have to click any extra buttons - just select the text you want and you're done.
I've tested tmux in terminal.app on macOS but it…
Mateusz Piotrowski
- 4,623
- 5
- 36
- 70
51
votes
2 answers
What's the difference between Primary Selection and Clipboard Buffer?
I am tweaking in Webkit-browser land in Linux and I come accross the terms "Primary Selection" and "Clipboard selection or buffer" very often.
I want to understand what are they and what difference do they have?
Where does drag and drop pasting…
r004
- 3,339
- 8
- 29
- 51
49
votes
3 answers
Gnome, nautilus copy files to USB stops at 100% or near
I had similar issues before but i don't remember how i solved it.
When i try to copy something to USB stick, with FAT, it stops near the end, sometimes at 100%. And of course, when i transfer the memory stick somewhere else, it doesn't contain…
user27938
48
votes
10 answers
Copy input to clipboard over SSH?
Here's my usage case:
I'm often connected to other computers over SSH for work and I often need to copy and paste documents/text from the server to locally running editors for writing examples and sharing text.
Often, if the text is small enough,…
Naftuli Kay
- 38,686
- 85
- 220
- 311
41
votes
4 answers
virt-manager copy paste functionality to the vm
Anyone know how to get Virtual Manager to install copy-paste functionality to the Virtual Machine?
FutuToad
- 703
- 2
- 11
- 21
39
votes
4 answers
How to copy file contents to the local clipboard from a file in a remote machine over ssh
To solve this problem I always have to use scp or rsync to copy the file into my local computer to open the file and simply copy the contents of the text file into my local clipboard. I was just wondering if there is a more clever way to do this…
VaTo
- 3,071
- 3
- 18
- 47