1

When use xst not in tmux, clipboard somehow share the same with the system/os/or-whatever-idk, but I can copy from firefox/chrome and paste into xst.

But with tmux I can't do that, tmux only allow use its own buffer, how to make tmux use the system buffer that share with other program?

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Tuyen Pham
  • 1,765
  • 1
  • 16
  • 46

2 Answers2

0

If you use linux you cloud add:

bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"

If on OSX use:

bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"

Taken from here

AdminBee
  • 21,637
  • 21
  • 47
  • 71
Julian
  • 87
  • 8
-1

tmux needs help from xsel (or another X clipboard manager).

I use xsel and add this to my ~/.tmux.conf, which will allow CTRL+B CTRL+C (copy) and CTRL+B CTRL+X (paste) to/from the X (PRIMARY) clipboard into the tmux selection buffer (and vice versa).

# turn on clipboard
set -g set-clipboard on

# copy tmux's selection buffer into the X clipboard selection
bind-key C-c run-shell "tmux show-buffer | xsel -b -i" \; \
display-message "Clipboard buffer copied to xsel ..."

# copy X clipboard selection into tmux's selection buffer
bind-key C-x run-shell "xsel -b -o | tmux load-buffer -" \; \
display-message "Clipboard buffer copied from xsel ..."
Joseph Tingiris
  • 1,706
  • 12
  • 20
  • Not quite sure but enable clipboard and all set `set -g set-clipboard on`. I can now use system buffer via pre-defined paste shortcut keyboard from system and do paste. – Tuyen Pham Nov 06 '18 at 19:53