Table of Contents
1 ${HOME}/.screenrc
ウィンドウを切り替える程度の用途でしか設定していません。
# Bind escape key to C-uescape ^Uu# Disable start messagestartup_message off# Enable status barhardstatus onhardstatus alwayslastline “%{= kW}%-Lw%{= wK}%n-%f %t%{= kW}%+Lw””# For broken ncurses, e.g. linux kernel make menuconfigcjkwidth off
1.1 screen上のssh先でさらにscreenした場合のエスケープキー
Host1で実行したscreen上でsshを使ってHost2へ接続し、さらにHost2上でscreenを実行した場合、Host2のscreen向けのエスケープキーはCtrl-u uとなります。
しかしいちいちCtrl-u uを押すのは面倒です。
私はscreenだけでなくtmuxでもそうしていますが、screen上のsshの接続先では、別の.screenrcを読み込むようにして別のエスケープキーを割り当てると良いでしょう。
私はmyscreen.shというスクリプトを用意して、上記の内容の.screenrcをescape ^Jjとしたmyscreen.configを用いています。
2 ${HOME}/.tmux.conf
上記の.screenrcを置き換えたものは以下の通りです。
# Bind escape key to C-uunbind-key -n C-aset -g prefix C-u# C-u u is for tmux inside tmux via ssh.bind-key u send-prefix# Disable left and right side information at status bar.set -g status-left ”set -g status-right ”# C-u C-u switch last window, true is for one window.bind C-u run “tmux last-window || true”# Window colorset -g status-fg whiteset -g status-bg black# Curernt window colorset -g window-status-current-fg blackset -g window-status-current-bg white