As I discussed a few days ago, I’m always open to a better offer when it comes to tools. Yesterday, Dan Croak write a massive post describing how to set up OS X for Ruby on Rails development. In the post he points to dot files shared on GitHub by Joe Ferris, and mentions that the shell they use is zsh (an alternative to bash that’s based on ksh).

I started wondering about the allure of zsh — I’ve used bash for a long time, and when I started using it, it was the most powerful shell around. I figured that if people were leaving bash for zsh, there must be some compelling reason, and I decided to do some research.

If you’re looking for the zsh argument, Fried CPU outlines the advantages. Item number 4 on his list, “Share history across sessions” was enough to convince me to give it a shot.

After changing my shell with chsh, it was time to start tweaking the shell configuration. I went back and looked at the .zshrc mentioned in Joe Ferris’ post and then I started looking around elsewhere for more. There are a bunch of zsh configuration files at <a href=”>, and from among them I found _why’s particularly useful. (He has some code that updates the title bar in your Terminal window in a useful fashion that’s a must have.)

We tell ourselves that we live in a rational, scientific society, but Unix configuration files clearly indicate that’s not the case. Various snippets are passed around like bits of ancient lore, with most people who use them having no idea why they do what they do. Count me among the ignorant and possibly superstitious. (See also: sync; sync; halt.) You can find my current zshrc here, but don’t ask me how it works, yet.

The coolest trick I’ve seen zsh pull so far involves svn add. zsh is smart enough to include only files that have not yet been added in the tab completion list when you hit tab after svn add. So if you have a directory of 10 files and only one of them is new, zsh is smart enough to choose that file when you hit tab. I love little bits of brilliance like that.

The secret is that zsh provides a highly extensible system for customizing tab completion, so there are tab completion packages for many tools that handle the special cases. (zsh’s autocompletion library for the kill command is somewhat famous.)

Playing with zsh is the best geeky distraction I’ve found in some time. I’d urge you to check it out.