ZSH on OS X Overview

From OS X Scientific Computing

Jump to: navigation, search
Return to ZSH on OS X.


Why zsh?

How to Install zsh on OS X

ZSH comes with OS X, so you don't need to install anything

The good news is that you don't have to install zsh. The only thing you have to do to become a full-fledged zsh user is to issue the following command:

chsh -s /bin/zsh

That's it. Then when you start a new login shell, it will start in zsh. If you need to go back, just issue the same command but with bash or tcsh substituting for zsh.

If you want to install a newer version of zsh

Installing with fink

  1. You need to be using the "unstable" branch of Fink. cf How to Activate the Unstable Branch
  2. Decide whether or not you want multibyte support (you may want this if you need to use non-ascii characters). Then issue the command
fink install zsh


fink install zsh-multibyte

Installing manually

You can get the latest zsh from ftp://ftp.zsh.org/pub/ . It is probably easiest to do the following. Make sure you are using the latest version. This is an example, and the version number may become obsolete soon:

mkdir ~/src
cd ~/src
curl -O ftp://ftp.zsh.org/pub/zsh-4.3.4.tar.bz2
curl -O ftp://ftp.zsh.org/pub/zsh-4.3.4-doc.tar.bz2
tar xvfj zsh-4.3.4.tar.bz2
tar xvfj zsh-4.3.4-doc.tar.bz2
cd zsh-4.3.4
perl -pi.bak -e "s;DL_EXT=so;DL_EXT=dylib;g" configure 
./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-curses-terminfo --with-tcsetpgrp --enable-maildir-support --enable-zsh-secure-free --bindir=/bin

sudo make install

I like to move fink out of the way temporarily to ensure it only links to system libraries, i.e.,

sudo mv  /sw    /sw.keep

install zsh as above

sudo mv  /sw.keep    /sw

How to Customize zsh on OS X

If you become a zsh geek, you will enjoy customizing your environment. I've made a set of zsh templates to help facilitate this sort of recreational activity. I've tried to make it general enough that it will encourage customization. I've put a lot of specific functionality for OS X into it, and also for the X-ray crystallographic community (which you can omit without effort).

What is this for?

For a more detailed explanation, please see my WTF is this? page.

If you want to give this a try, there are two ways to do this:

If you are using the system's default zsh or manually-compiled zsh

Please refer to my page entitled ZSH on OS X: Installing customization templates

If you have installed zsh with Fink

If you are using /sw/bin/zsh as your zsh shell, then all you need to do is to issue the command

fink install zsh-templates

You might also want to issue

fink install zsh-helpfiles

Return to ZSH on OS X.
Personal tools