Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Using tmux both 1.7 and 1.8.

I see \; in tmux.conf files everywhere, but it fails with an error when I add it to mine. Here is an example:

bind -t vi-copy 'y' copy-selection \; run-shell "tmux save-buffer - | curl -d @- localhost:5482"

I get this error:

/Users/user/.tmux.conf:30: usage: bind-key [-cnr] [-t key-table] key command [arguments]

Examples here:

  1. How can I bind multiple tmux commands to one keystroke?

  2. http://superuser.com/questions/562567/tmux-bind-key-and-running-shell-isnt-working

Seems to only happen when using the bind -t option.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

The key table bindings (those made with -t) use a different set of commands (only movement and editing); they also do not allow \; to execute multiple commands.

The copy-pipe “mode” command (new in tmux 1.8) looks like it will probably be useful for your particular situation:

bind-key -t vi-copy y copy-pipe "curl -d @- localhost:5482"

You may also need to switch to --data-binary or --data-urlencoded to preserve your data.

share|improve this answer

I ended up doing it like this using netcat today that is pretty dead simple.

https://github.com/base698/tmux-copy-paste-mac-osx

Here is the tmux.conf:

bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-pipe 'nc localhost 5682'
bind p run-shell 'nc localhost 5683; nc localhost 5683 | tmux load-buffer -' \; paste-buffer
bind p run-shell 'nc localhost 5683; nc localhost 5683

Works with the mouse too in 1.8

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.