MacOS Xでzshを使う

MacOS Xのログインシェルが、いつのまにかbashになってた。普段はzshを使ってるので、zshに変更した。
zshは最新のものが欲しかったので、Finkからインストール。zsh-multibyteとzshの違いがわからなかったので、とりあえずzsh-multibyteを選択。

$ fink install zsh-multibyte
Information about 5452 packages read in 1 seconds.
The following package will be installed or updated:
 zsh-multibyte
The following 3 additional packages will be installed:
 pcre pcre-bin pcre-shlibs
Do you want to continue? [Y/n] Y

以下略

無事にインストールが完了したら、/etc/shellsに/sw/bin/zshを追加。

$ sudo vi /etc/shells

最後にchpassを使って自分のログインシェルを変更すれば完了。

$ chpass -s /sw/bin/zsh

おもむろにターミナルを開いて確認すると、なんと対話的な設定画面があらわれた。ホームディレクトリにzshの設定ファイルがないと、この状態になるみたい。

This is the Z Shell configuration function for new users, zsh-newuser-install.
You are seeing this message because you have no zsh startup files
(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory
~).  This function can help you with a few settings that should
make your use of the shell easier.

You can:

(q)  Quit and do nothing.  The function will be run again next time.

(0)  Exit, creating the file ~/.zshrc containing just a comment.
     That will prevent this function being run again.

(1)  Continue to the main menu.

--- Type one of the keys in parentheses --- 

せっかくなので、(1)を選択してメニューを表示してみた。ヒストリー、補完、コマンドラインエディットの設定と、基本的なところは押さえてる感じ。

Please pick one of the following options:

(1)  Configure settings for history, i.e. command lines remembered
     and saved by the shell.  (Recommended.)

(2)  Configure the new completion system.  (Recommended.)

(3)  Configure how keys behave when editing command lines.  (Recommended.)

(4)  Pick some of the more common shell options.  These are simple "on"
     or "off" switches controlling the shell's features.  

(0)  Exit, creating a blank ~/.zshrc file.

(a)  Abort all settings and start from scratch.  Note this will overwrite
     any settings from zsh-newuser-install already in the startup file.
     It will not alter any of your other settings, however.

(q)  Quit and do nothing else.  The function will be run again next time.
--- Type one of the keys in parentheses --- 

結局、(0)で空の.zshrcを作って終了した。とりあえずFinkのinit.shを読み込む設定だけ移植して、カスタマイズはまた今度。

test -r /sw/bin/init.sh && . /sw/bin/init.sh