LoginSignup
7
5

More than 5 years have passed since last update.

MSYS2環境でtmuxとクリップボードの共有

Last updated at Posted at 2016-01-13

/dev/clipboard を使って .tmux.conf にこんな感じで書けば良い。容赦なくデフォルトのバインディングを潰してるので、それが嫌な人は別のキーに当てればO.K.。

bind -n -t emacs-copy C-w copy-pipe "cat > /dev/clipboard"
bind ] run "cat /dev/clipboard | tmux load-buffer - && tmux paste-buffer"

【2017-11-11追記】 tmux 2.4 以降での設定

https://qiita.com/KanchiShimono/items/d3904c0dc4acf40b6705 ということなので、変更が必要。以下で動いた気がする。

bind -n -T copy-mode C-w send-keys -X copy-pipe-and-cancel "cat > /dev/clipboard"
bind ] run "cat /dev/clipboard | tmux load-buffer - && tmux paste-buffer"
7
5
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
7
5