#navi_header|技術| Cygwin 1.7でminttyでCygwinを実行すると、minttyのウインドウのタイトルが"- bash"という具合に非常に味気ない状態で起動します。 xtermなどのグラフィカルなターミナルエミュレータでは、制御コードを出力することでウインドウのタイトルを変更できます。 そこで、以下のようにbashのcdとpwdを再定義し、cdやpwd実行時にカレントディレクトリをminttyのウインドウタイトルに表示するようにしておくと便利です。 .bashrc: #pre||> ... function settitle () { t="[$@]@`hostname`" # "\e]2;"までがウインドウタイトル変更開始の制御コード # "\007"が変更終了・・・らしい、です。 echo -ne "\e]2;$t\007" } function cd() { builtin cd $@ && settitle $(cygpath -m `/usr/bin/pwd`) } function pwd() { settitle $(cygpath -m `/usr/bin/pwd`) builtin pwd $@ } ||< ただしこれだと、全部が全部 cygpath で実際のWindowsフォルダ・ファイルパス表記になってしまい分かりづらいかもしれません。Cygwin世界の表記をそのままあ使うのであれば、 settitle $(cygpath -m `/usr/bin/pwd`) -> settitle `builtin pwd` でも良いと思います。 動作確認: Win7SP1日本語版 $ cygcheck -c cygwin bash mintty Cygwin Package Information Package Version Status bash 4.1.10-4 OK cygwin 1.7.16-1 OK mintty 1.1.1-1 OK 参考: - cygwin - How to change the title of the mintty window? - Super User -- http://superuser.com/questions/362227/how-to-change-the-title-of-the-mintty-window #navi_footer|技術|