The version of ZSH that comes with OS X is outdated. Grab the most recent one with Homebrew:
brew update
brew install zsh
Next, we need to tell OS X that we trust the version of ZSH we just installed. Type sudo nano /etc/shells
and hit enter. This will load a terminal text editor. Use the arrow keys to scroll all the way down to the bottom, then type /usr/local/bin/zsh
. The file should look something like this:
# List of acceptable shells for chpass(1)
# Ftpd will not allow users to connect who are not using
# one of these shells.
/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/zsh
Hit CTRL-X
to quit, then hit Y
to save, then hit Enter
.
ZSH is insanely customizable, but it's usually really complicated to accomplish. Prezto is a toolkit for making the customization of ZSH a little bit easier. It's a collection of pre-built themes and plugins that you can combine pretty much however you want.
Here's how to install Prezto in Terminal:
git clone --recursive https://github.com/sorin-ionescu/prezto ~/.zprezto
cd ~/.zprezto/runcoms
ln -s $PWD/zlogin ~/.zlogin
ln -s $PWD/zpreztorc ~/.zpreztorc
ln -s $PWD/zprofile ~/.zprofile
ln -s $PWD/zshenv ~/.zshenv
ln -s $PWD/zshrc ~/.zshenv
cd ~
Next, change your default shell to ZSH with this command (you'll be prompted for your password):
chsh -s /usr/local/bin/zsh
Finally open a new tab in Terminal and close the one you were just working in. You should see a pretty rainbow-colored shell prompt.
Prezto does a lot out of the box, but there's even more stuff you can add. See the other file attached to this gist for ideas.