1

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. https://superuser.com/questions/562567/tmux-bind-key-and-running-shell-isnt-working

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

1

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.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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