Adam's zsh page
zsh is a great UNIX shell. It
has all the benefits of other standard shells, and a hell of a lot
more on top. I'm interested in the interactive features in
particular, because they can save you a lot of time and effort.
OK, here's some of the really cool stuff. A few of the other
shells have some of these features, although in general zsh does it
more comprehensively.
- A mind-bogglingly powerful new completion
system, complete with out of the box completion heuristics
for many standard UNIX commands. Very
little effort is required to utilise this system, which can
save hours of typing in the long run.
- Globbing -- extremely powerful, basically an easier-to-type replacement
for find, e.g. to find all ssh-agent sockets owned by yourself:
zsh% ls /tmp/ssh-*/*(=U)
- Coloured menu completion (just bounce on the TAB key until what you want
appears)
- Multi-line commands editable as a single buffer (even files!)
- Variable editing (vared) -- finally you can easily
edit your
$PATH
interactively
- Command buffer stack -- halfway through typing a complex command
on a crappy old terminal and suddenly realise you need to do some
other stuff first? Just hit M-q ... your command gets
pushed onto the stack to be automatically popped off next time you
hit enter.
- Print text straight into the buffer for immediate editing (print -z)
- Inline expansion of variables and history commands
- Advanced history handling, included incremental sharing with multiple simultaneous shells
- Handling of multiple redirections (simpler than tee)
- Large number of options for tailoring (see my
.zshrc)
- Spelling correction
- Manipulation of arrays (including reverse subscripting)
- Comprehensive integer and floating point arithmetic
- Adaptable messages for: spelling correction, watching of users
logging on/off, new mail in multiple mailboxes, time as well
as prompt (including conditional expressions)
- Dynamically loadable modules including one providing command-line-based ftp
client functionality.
- A themeable prompts system full of silly prompts, some pinched
from bashprompt and
improved, others written from scratch. There is a screenshot
available which demonstrates
this system. To use it, simply install zsh 4, and then do the
following at your prompt:
zsh% autoload promptinit
zsh% promptinit
zsh% prompt -h
Please note that you'll need the relevant X terminal fonts
installed so that your X server can get at them. I've
made up a tarball of the
fonts I use and a README which briefly explains how to
install the fonts. Someone else did a
similar page before me too.
- Countless other improvements. The zsh FAQ currently
mentions some of them.
Versions of zsh
Confused about the various versions of zsh available? Here's a
quick summary:
- 4.0.4
- The latest stable release, at the time of writing. You can
always get the latest stable version from zsh's file
area on sourceforge.net.
- SourceForge CVS
- The latest development tree is available via
CVS from sourceforge.net. zsh also has
a project
home page on this site.
- 4.1.x-dev-y
- The latest official development release branch, at the time of
writing. These are official intermediate development versions
compiled by Peter Stephenson (pws) from patches selected from zsh-workers and committed to
the HEAD branch in CVS. They are sometimes released once a week,
sometimes less often, and are available
in the development subdirectory of your local mirror
site; see www.zsh.org to find
out which mirror site is nearest to you.)
If you were to put them on a scale, it would be something like
this:
4.x.y, x even 4.x.y, x odd intermediate devel CVS at
(e.g. 4.0.2) (e.g. 4.1.0) releases (dev, pws) sourceforge.net
<------------------------------------------------------------------------>
least often released / most often released /
most stable most bleeding edge
Other bits'n'pieces available:
Peter Stephenson has written an excellent, user-friendly user's guide to
zsh which is very helpful for those who really want to get to
grips with the power features of zsh.
Last updated: Tue Feb 3 15:01:00 2004
© 1995-2003
Adam Spiers <adam@spiers.net>