You are not logged in.

#1 2013-10-23 11:43:58

rezahousseini
Member
Registered: 2013-09-06
Posts: 17

tmux how to copy to clipboard

Hello

In tmux copy-mode I'm using the vi-mode. So pressing "v" allows one to select text and "y" to paste the selected text. I want now that the selected text is after pressing "y" directly sent to my X clipboard, without using additional shortcuts.
I was searching the web for quiet a long time but didn't come up with a solution.

Is there anyone who is using something similar?

It seems it is possible doing so in a Mac [1].


Thanks for any solution!

Cheers
Reza

[1] http://robots.thoughtbot.com/post/55885 … ter-future

Offline

#2 2013-10-23 12:01:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,546
Website

Re: tmux how to copy to clipboard

The same thing should work, except you'd use something like xsel instead of the mac-specific command in quotes in the binding.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2013-10-23 12:02:02

Jellicent
Member
From: Berlin
Registered: 2013-09-13
Posts: 189

Re: tmux how to copy to clipboard

Nevermind, I understood the whole problem wrongly.

Last edited by Jellicent (2013-10-23 12:03:11)

Offline

#4 2013-10-23 12:42:26

rezahousseini
Member
Registered: 2013-09-06
Posts: 17

Re: tmux how to copy to clipboard

I tried

bind-key -t vi-copy y copy-pipe "cat | xclip -selection clipboard -i"

but it doesn't work, what is the problem?

Offline

#5 2013-10-23 13:07:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,546
Website

Re: tmux how to copy to clipboard

I've never used tmux in this way, nor have I used xclip.  But you may want to call the pound, you have a stray cat lingering around.

"xsel -b" should be the equivalent of the osx instruction.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2013-10-24 05:34:14

rezahousseini
Member
Registered: 2013-09-06
Posts: 17

Re: tmux how to copy to clipboard

Hmm seems not to work for me...
Can someone test this, because I might have messed up something somewhere.

Offline

#7 2013-10-24 12:47:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,546
Website

Re: tmux how to copy to clipboard

Have you tried the solution on the wiki?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB