LoginSignup
18
7

More than 3 years have passed since last update.

Ubuntuでtmuxとクリップボードを共有する

Last updated at Posted at 2017-06-10

環境

  • Ubuntu16.04
  • tmux2.3

必要なもの

xselxclip のどちらかを使う。

sudo apt install xsel
sudo apt install xclip

vi mode時の設定

xselの場合

bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "xsel -ip && xsel -op | xsel -ib"
bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "xsel -ip && xsel -op | xsel -ib"

xclipの場合

bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -sel clip > /dev/null"
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -sel clip > /dev/null"

emacs mode時の設定

xselの場合

bind-key -T copy-mode y send -X copy-pipe-and-cancel "xsel -ip && xsel -op | xsel -ib"

xclipの場合

bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel "xclip -i -sel clip > /dev/null"
18
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
7