CentOSでscreenのクリップボードとXのクリップボードを共有する

epelリポジトリからxclipをインストール

# yum --enablerepo=epel -y install xclip

http://d.hatena.ne.jp/Shinnya/20100623/1277279977 を参考に以下を.screnrcに追加。

bindkey -m ' ' eval 'msgwait 0' 'stuff \040' writebuf 'exec !!! xclip /tmp/screen-exchange' 'msgwait 2'
bindkey -m Y eval 'msgwait 0' 'stuff Y' writebuf 'exec !!! xclip /tmp/screen-exchange' 'msgwait 2'
bindkey -m y eval 'msgwait 0' 'stuff y' writebuf 'exec !!! xclip /tmp/screen-exchange' 'msgwait 2'
bindkey -m W eval 'msgwait 0' 'stuff W' writebuf 'exec !!! xclip /tmp/screen-exchange' 'msgwait 2'

.screenrcの再読み込み

Ctrl+<コマンド文字>
:
source ${HOME}/.screenrc
  • 環境
# rpm -q centos-release
centos-release-5-5.el5.centos
# screen -v
Screen version 4.00.03jw4 (FAU) 2-May-06
# xclip -version
xclip version 0.08
Copyright (C) 2001 Kim Saunders
Distributed under the terms of the GNU GPL
  • 参考

http://d.hatena.ne.jp/Shinnya/20100623/1277279977