Help us understand the problem. What is going on with this article?

GNU screen のコピー機能と、クリップボードの同期

More than 5 years have passed since last update.

.zshrc とか .bashrc にこう書く

if which xsel > /dev/null 2>&1
then
    # X Window System 環境でのコピー (xsel をインストールする必要あり)
    copy_cmd="xsel -i -b < /tmp/screen-exchange;\
              xsel -i -p < /tmp/screen-exchange"
elif which pbcopy > /dev/null 2>&1
then
    # Mac OS X 環境でのコピー (要動作テスト)
    copy_cmd="pbcopy < /tmp/screen-exchange"
elif which putclip > /dev/null 2>&1
then
    # Cygwin 環境でのコピー(要動作テスト)
    copy_cmd="putclip < /tmp/screen-exchange"
fi
[ $STY ] && [ $copy_cmd ] &&\
  screen -X bindkey -m ' ' eval "stuff ' '" writebuf "exec sh -c '$copy_cmd'"

bash では動作テストしてないけど多分動く。

screen でシェル立ち上げるたびにキーバインド設定されてしまうの気持ち悪いのでどうにかしたい。

k_ui
ねこほしい
http://k-ui.jp
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away