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?

2 Answers 2

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

-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 ..."
1
  • 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 6, 2018 at 19:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .