1
5

More than 5 years have passed since last update.

screenrcの設定とコマンドメモ

Last updated at Posted at 2018-09-26

screenrcの設定をいつも忘れるのでメモ

参考

https://qiita.com/kamykn/items/9939b67e923dbb87f39c
コマンド
https://bacchi.me/linux/how-2-use-screen/

立ち上げ

screen -S work

ローカルのscreenの設定

ローカルはj、ssh先はnに変えると画面左下の色が変わってわかりやすい。デフォルトのaだとカーソル移動とかぶるので変えるのが良い。

タブ(新しいスクリーン)は[Ctrl + j] + c
[Ctrl + j] + n または [Ctrl + j] + [space]:昇順移動  
[Ctrl + j] + p または  [Ctrl + j] + [del]:降順移動  
ローカルに戻る[Ctrl + b] + n
ssh先に移動[Ctrl + j] + n
消すとき[Ctrl + j] + k もしくは[Ctrl + d]

screenrcの例

~/.screenrc
# Prefix Key
#ssh先とローカルで変える
escape ^Jj
#escape ^Bb

# use bright colors for bold text.
attrcolor b ".I"

# enable background-color-erase setting
defbce on

# enable 256 color
termcapinfo xterm* 'Co#256:AB=¥E[48;5;%dm:AF=¥E[38;5;%dm'

# set statusbar
shelltitle "$ |$HOSTNAME"
# format                   time                   title selected title         load

#画面左下のバーの色をローカルとssh先で切り替える
#緑
hardstatus alwayslastline "%{= gk}[%m/%d %02c:%s] %{gk} %-w%{= GK}%n %t%{-}%+w %=%{gk}%l"
#青
#hardstatus alwayslastline "%{= ck}[%m/%d %02c:%s] %{ck} %-w%{= CK}%n %t%{-}%+w %=%{ck}%l"
#黄色
#hardstatus alwayslastline "%{= yk}[%m/%d %02c:%s] %{yk} %-w%{= YK}%n %t%{-}%+w %=%{yk}%l"
hardstatus off

## スクロール行数
defscrollback 10000

## マウススクロール有効
termcapinfo xterm* ti@:te@
#macのターミナルなら、ターミナルの環境設定の『代替スクリーンをスクロール』をチェック外すとトラックパッドのスク
ロールがそのまま反映されるようになる

# vimとかlessとかtigとかのバッファを終了時に消す
altscreen on
1
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
1
5