tmuxでscreen256を設定した時にリモート接続先でsshエラー
問題と解決方法
localのtmuxでscreen-256colorで起動したい場合などは以下に設定すると思います
set -g default-terminal "screen-256color"
上記の設定にしていると、sshを利用したremote接続先までそのTERMが継承されるtmuxの仕様なので当然CentOSなどの接続先でエラーが出てくる。
'screen-256color': unknown terminal type.
そのため、以下をzshrcかbashrcにaliasにする。
alias ssh='TERM=xterm ssh'
特定のサーバには256系でログインしたい[追記:2013/1/29]
ログイン先各サーバへ以下をインストールする。
yum -y install ncurses-term
そして自分のbashに以下も設定する
alias ssh256='TERM=xterm-256color /usr/bin/ssh'