状況
bashでsshを切断した時にターミナルのタイトルにsshの接続先 user@xxx.xx.xxx.xx:~
というのが残るのが気になり、その方法を以前調べて設定したものの、情報が見つけにくいのでメモ代わりに残すことにする。
どうするのか
簡単に言うと、リモート側の ~/.bash_logout
に以下の設定を追加するだけでいい。
# ~/.bash_logout: executed by bash(1) when login shell exits.# Clears terminal's titleprintf'\e]0;\a'
注意
おそらくbashでないと効果がないと思われます。