• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..19-Feb-20148

.distfilesH A D27-Nov-2013293

.editorconfigH A D27-Nov-2013122

.preconfigH A D27-Nov-201358

aclocal.m4H A D03-Jul-20072.3 KiB

aczsh.m4H A D16-May-200919.1 KiB

ChangeLogH A D05-Jan-201459.4 KiB

Completion/H24-Oct-201423

Config/H24-Oct-201410

config.guessH A D10-Dec-201143.9 KiB

config.h.inH A D29-Nov-201333.3 KiB

config.subH A D10-Dec-201133.6 KiB

configureH A D29-Nov-2013384 KiB

configure.acH A D27-Nov-201398 KiB

Doc/H24-Oct-201447

Etc/H24-Oct-201428

FEATURESH A D15-Jun-20125.2 KiB

Functions/H24-Oct-201417

INSTALLH A D17-Dec-201329.3 KiB

install-shH A D12-Jun-200712.9 KiB

LICENCEH A D05-Jan-20141.9 KiB

MACHINESH A D02-Jan-20147.4 KiB

Makefile.inH A D19-Feb-20145.2 KiB

META-FAQH A D08-Sep-20123.9 KiB

Misc/H19-Feb-201412

mkinstalldirsH A D19-Dec-20123.5 KiB

NEWSH A D16-Dec-201343.1 KiB

READMEH A D03-Jan-201418.3 KiB

Scripts/H19-Feb-20144

Src/H24-Oct-201456

stamp-h.inH A D15-Sep-20121

StartupFiles/H19-Feb-20146

Test/H24-Oct-201450

Util/H19-Feb-20148

README

1-----------------
2THE Z SHELL (ZSH)
3-----------------
4
5Version
6-------
7
8This is version 5.0.5 of the shell.  This is a stable release.
9There are minor new features as well as bug fixes since 5.0.2.
105.0.3 and 5.0.4 were short-lived releases with most of the features of
115.0.5 that were replaced owing to significant bugs.
12
13Installing Zsh
14--------------
15
16The instructions for compiling zsh are in the file INSTALL.  You should
17also check the file MACHINES in the top directory to see if there
18are any special instructions for your particular architecture.
19
20Note in particular the zsh/newuser module that guides new users through
21setting basic shell options without the administrator's intervention.  This
22is turned on by default.  See the section AUTOMATIC NEW USER CONFIGURATION
23in INSTALL for configuration information.
24
25Features
26--------
27
28Zsh is a shell with lots of features.  For a list of some of these, see the
29file FEATURES, and for the latest changes see NEWS.  For more
30details, see the documentation.
31
32Incompatibilities between 5.0.2 and 5.0.5
33-----------------------------------------
34
35The "zshaddhistory" hook mechanism documented in the zshmisc manual page
36has been upgraded so that a hook returning status 2 causes a history
37line to be saved on the internal history list but not written to the
38history file.  Previously any non-zero status return would cause
39the line not to be saved on the history at all.  It is recommended
40to use status 1 for this (indeed most shell users would naturally do
41so).
42
43Incompatibilities between 5.0.0 and 5.0.2
44-----------------------------------------
45
46In 5.0.0, the new "sticky" emulation feature was applied to functions
47explicitly declared within an expression following `emulate ... -c', but
48did not apply to functions marked for autoload in that expression.  This
49was not documented and experience suggests it was inconvenient, so in
505.0.2 autoloads also have the sticky property.
51
52In other words,
53
54  emulate zsh -c 'func() { ... }'
55
56behaves the same way in 5.0.0 and 5.0.2, with the function func always being
57run in native zsh emulation regardless of the current option settings.
58However,
59
60  emulate zsh -c 'autoload -Uz func'
61
62behaves differently: in 5.0.0, func was loaded with the options in
63effect at the point where it was first run, and subsequently run with
64whatever options were in effect at that point; in 5.0.2, func is loaded
65with native zsh emulation options and run with those same options.  This
66is now the recommended way of ensuring a function is loaded and run with
67a consistent set of options.
68
69Note that the command `autoload -z' has never affected the options
70applied when the function is loaded or run, only the effect of the
71KSH_AUTOLOAD option at the point the function is loaded.
72
73Possible incompatibilities between 4.2 and 5.0
74----------------------------------------------
75
76Here are some incompatibilities in the shell since the 4.2 series of
77releases.  It is hoped most users will not be adversely affected by these.
78
79In previous releases of the shell, builtin commands and precommand
80modifiers that did not accept options also did not recognize the
81argument "--" as marking the end of option processing without being
82considered an argument.  This was not documented and was incompatible
83with other shells.  All such commands now handle this syntax.
84
85The configuration option --enable-lfs to enable large file support has
86been replaced by autoconf's standard --enable-largefile mechanism.
87As this is usually used whenever necessary, this won't usually
88be noticeable; however, anyone configuring with --disable-lfs
89should configure with --disable-largefile instead.
90
91The configuration option --with-curses-terminfo has been replaced
92by the option --with-term-lib="LIBS" where LIBS is a space-separated
93list of libraries to search for termcap and curses features.
94
95The option SH_WORD_SPLIT, used in Bourne/Korn/Posix shell compatibility
96mode, has been made more like other shells in the case of substitutions of
97the form ${1+"$@"} (a common trick used to work around problems in older
98Bourne shells) or any of the related forms with the + replaced by - or =
99with an optional colon preceding.  Previously, with SH_WORD_SPLIT in
100effect, this expression would cause splitting on all white space in the
101shell arguments.  (This was always regarded as a bug but was long-standing
102behaviour.)  Now it is treated identically to "$@".  The same change
103applies to expressions with forced splitting such as ${=1+"$@"}, but
104otherwise the case where SH_WORD_SPLIT is not set is unaffected.
105
106Debug traps (`trap ... DEBUG' or the function TRAPDEBUG) now run by default
107before the command to which they refer instead of after.  This is almost
108always the right behaviour for the intended purpose of debugging and is
109consistent with recent versions of other shells.  The option
110DEBUG_BEFORE_CMD can be unset to revert to the previous behaviour.
111
112Previously, process substitutions of the form =(...), <(...) and >(...)
113were only handled if they appeared as separate command arguments.
114(However, the latter two forms caused the current argument to be
115terminated and a new one started even if they occurred in the middle of
116a string.)  Now all three may be followed by other strings, and the
117latter two may also be preceded by other strings.  Remaining
118limitations on their use (to reduce incompatibilities to a minimum)
119are documented in the zshexpn.1 manual.
120
121In previous versions of the shell it was possible to use index 0 in an
122array or string subscript to refer to the same element as index 1 if the
123option KSH_ARRAYS was not in effect.  This was a limited approximation to
124the full KSH_ARRAYS handling and so was not very useful.  In this version
125of the shell, this behaviour is only provided when the option
126KSH_ZERO_SUBSCRIPT is set.  Note that despite the name this does not provide
127true compatibility with ksh or other shells and KSH_ARRAYS should still be
128used for that purpose.  By default, the option is not set; an array
129subscript that evaluates to 0 returns an empty string or array element and
130attempts to write to an array or string range including only a zero
131subscript are treated as an error.  Writes to otherwise valid ranges that
132also include index zero are allowed; hence for example the assignment
133  array[(R)notfound,(r)notfound]=()
134(where the string "notfound" does not match an element in $array) sets the
135entire array to be empty, as in previous versions of the shell.
136KSH_ZERO_SUBSCRIPT is irrelevant when KSH_ARRAYS is set.  Also as in previous
137versions, attempts to write to non-existent elements at the end of an array
138cause the array to be suitably extended.  This difference means that, for
139example
140  array[(R)notfound]=(replacement)
141is an error if KSH_ZERO_SUBSCRIPT is not set (new behaviour), while
142  array[(r)notfound]=(replacement)
143causes the given value to be appended to the array (same behaviour as
144previous versions).
145
146The "exec" precommand modifier now takes various options for compatibility
147with other shells.  This means that whereas "exec -prog" previously
148tried to execute a command name "-prog", it will now report an error
149in option handling.  "exec -- -prog" will execute "-prog".  If
150the option EQUALS is set, as it is by default in zsh's native mode,
151"exec =-prog" behaves the same way in all versions of zsh provided
152the command can be found.
153
154The "unset" builtin now does not regard the unsetting of non-existent
155variables as an error, so can still return status 0 (depending on the
156handling of other arguments).  This appears to be the standard shell
157behaviour.
158
159The variable BAUD is no longer set automatically by the shell.
160In previous versions it was set to the baud rate reported by
161the terminal driver in order to initialise the line editor's
162compensation mechanism for slow baud rates.  However, the baud
163rate so reported is very rarely related to the limiting speed of
164screen updates on modern systems.  Users who need the compensation
165mechanism should set BAUD to an appropriate rate by hand.
166
167The variable HOME is no longer set by the shell if zsh is emulating any
168other shell at startup; it must be present in the environment or set
169subsequently by the user.  It is valid for the variable to be unset.
170
171If the shell starts in a mode where it is emulating another shell
172(typically because the base name of the shell was "sh" or another known
173shell), the "repeat" syntax is not available by default, to avoid clashes
174with external commands, but the "ulimit" command is available by default.
175"limit", "sched" and "unlimit" are not available by default in such modes:
176this has been the case for many versions but is now documented for the
177first time.  (Users should note that emulation modes are not designed for
178backwards compatibility with previous versions of zsh, but to maximise
179compatibility with other shells, hence it is not safe to assume emulation
180modes will behave consistently between zsh versions.)
181
182Parameter substitutions in the form ${param//#%search/replace} match
183against "search" anchored at both ends of the parameter value.  Previously
184this syntax would have matched against "%search", anchored only at the head
185of the value.  The form ${param//#$search/replace} where the value
186$search starts with "%" considers the "%" to be part of the search
187string as before.
188
189Configure attempts to decide if multibyte characters are supported by the
190system and if so sets the effect of --enable-multibyte, unless
191--disable-multibyte was passed on the command line.  When
192--enable-multibyte is in effect, the MULTIBYTE shell option is on by
193default; this causes many operations to recognise characters in the current
194locale.  (Most typically this is used for a UTF-8 character set but the
195shell will work with any character set provided by the system where
196individual octets are either US ASCII characters or have the top bit set.)
197Older versions of the shell always assumed a character was one byte; this
198remains the case if --disable-multibyte is in effect or if the MULTIBYTE
199option is unset.  In some places the width of characters will be taken into
200account where previously a raw string length was used; this is transparent
201in calculations of screen position, but also occurs, for example, in
202calculations of padding width.  Note that MULTIBYTE is not automatically
203set when emulating Bourne- and POSIX-style shells; for interactive use of
204these emulations it may be necessary to set it by hand.  Note also that the
205option COMBINING_CHARS is not set by default due to difficulties detecting
206the ability of the terminal to display combining characters correctly; MAC
207users in particular will probably wish to set this option.
208
209Zsh has previously been lax about whether it allows octets with the
210top bit set to be part of a shell identifier.  Older versions of the shell
211assumed all such octets were allowed in identifiers, however the POSIX
212standard does not allow such characters in identifiers.  The older
213behaviour is still obtained with --disable-multibyte in effect.
214With --enable-multibyte in effect (see previous paragraph) there are three
215possible cases:
216  MULTIBYTE option unset:  only ASCII characters are allowed; the
217    shell does not attempt to identify non-ASCII characters at all.
218  MULTIBYTE option set, POSIX_IDENTIFIERS option unset: in addition
219    to the POSIX characters, any alphanumeric characters in the
220    local character set are allowed.  Note that scripts and functions that
221    take advantage of this are non-portable; however, this is in the spirit
222    of previous versions of the shell.  Note also that the options must
223    be set before the shell parses the script or function; setting
224    them during execution is not sufficient.
225  MULITBYTE option set, POSIX_IDENTIFIERS set:  only ASCII characters
226    are allowed in identifiers even though the shell will recognise
227    alphanumeric multibyte characters.
228
229The sched builtin now keeps entries in time order.  This means that
230after adding an entry the index of an existing entry used for deletion
231may change, if that entry had a later time than the new entry.  However,
232deleting a entry with a later time will now never change the index of an
233entry with an earlier time, which could happen with the previous method.
234
235The completion style pine-directory must now be set to use completion
236for PINE mailbox folders; previously it had the default ~/mail.  This
237change was necessary because otherwise recursive directories under
238~/mail were searched by default, which could be a considerable unnecessary
239hit for anyone not using PINE.  The previous default can be restored with:
240  zstyle ':completion:*' pine-directory ~/mail
241
242The completion style fake-files now allows patterns as directories,
243for example the value '/home/*:.snapshot' is now valid.  This will
244only cause problems in the unlikely event that a directory in the style
245has a pattern character in it.
246
247The default maximum function depth (configurable with
248--enable-max-function-depth) has been decreased to 1000 from 4096.  The
249previous value was observed to be small enough that crashes still occurred
250on some fairly common PC configurations.  This change is only likely to
251affect some highly specialised uses of the shell.
252
253The variables HISTCHARS and histchars now reject any attempt to
254set non-ASCII characters for history or comments.  Multibyte characters
255have never worked and the most consistent change was to restrict the
256set to portable characters only.
257
258Writers of add-on modules should note that the API has changed
259significantly to allow user control of individual features provided by
260modules.  See the documentation for zmodload -F and
261Etc/zsh-development-guide, in that order.
262
263Documentation
264-------------
265
266There are a number of documents about zsh in this distribution:
267
268Doc/Zsh/*.yo	The master source for the zsh documentation is written in
269		yodl.  Yodl is a document language written by Karel Kubat.
270		It is not required by zsh but it is a nice program so you
271		might want to get it anyway, especially if you are a zsh
272		developer.  It can be downloaded from
273		ftp://yodl.sourceforge.net/
274
275Doc/zsh*.1	Man pages in nroff format.  These will be installed
276		by "make install.man" or "make install".  By default,
277		these will be installed in /usr/local/man/man1, although
278		you can change this with the --mandir option to configure
279		or editing the user configuration section of the top level
280		Makefile.
281
282Doc/zsh.texi	Everything the man pages have, but in texinfo format.  These
283		will be installed by "make install.info" or "make install".
284		By default, these will be installed in /usr/local/info,
285		although you can change this with the --infodir option to
286		configure or editing the user configuration section of the
287		top level Makefile.  Version 4.0 or above of the
288		Texinfo tools are recommended for processing this file.
289
290Also included in the distribution are:
291
292Doc/intro.ms	An introduction to zsh in troff format using the ms
293		macros.  This document explains many of the features
294		that make zsh more equal than other shells.
295		Unfortunately this is based on zsh-2.5 so some examples
296		may not work without changes but it is still a good
297		introduction.
298
299For more information, see the website, as described in the META-FAQ.
300
301If you do not have the necessary tools to process these documents, PDF,
302Info and DVI versions are available in the separate file zsh-doc.tar.gz at
303the archive sites listed in the META-FAQ.
304
305The distribution also contains a Perl script in Utils/helpfiles which
306can be used to extract the descriptions of builtin commands from the
307zshbuiltins manual page.  See the comments at the beginning of the
308script about its usage.  The files created by this script can be used
309by example function run-help located in the subdirectory Functions/Misc to
310show information about zsh builtins and run `man' on external commands.
311For this the shell variable HELPDIR should point to a directory containing
312the files generated by the helpfiles script.  run-help should be
313unaliased before loading the run-help function.  After that this function
314will be executed by the run-help ZLE function which is by default bound
315to ESC-h in emacs mode.
316
317Examples
318--------
319
320Examples of zsh startup files are located in the subdirectory
321StartupFiles.  Examples of zsh functions and scripts are located in
322the subdirectory Functions.  Examples of completion control commands
323(compctl) are located in the file Misc/compctl-examples.
324
325Zsh FTP Sites, Web Pages, and Mailing Lists
326-------------------------------------------
327
328The current list of zsh FTP sites, web pages, and mailing lists can be
329found in the META-FAQ.  A copy is included in this distribution and is
330available separately at any of the zsh FTP sites.
331
332Common Problems and Frequently Asked Questions
333----------------------------------------------
334
335Zsh has a list of Frequently Asked Questions (FAQ) maintained by Peter
336Stephenson <pws@zsh.org>.  It covers many common problems encountered
337when building, installing, and using zsh.  A copy is included in this
338distribution in Etc/FAQ and is available separately at any of the zsh
339ftp sites.
340
341Zsh Maintenance and Bug Reports
342-------------------------------
343
344Zsh is currently maintained by the members of the zsh-workers mailing list
345and coordinated by Peter Stephenson <coordinator@zsh.org>.  Please send
346any feedback and bugs reports to <zsh-workers@zsh.org>.
347
348Reports are most helpful if you can reproduce the bug starting zsh with
349the -f option.  This skips the execution of local startup files except
350/etc/zshenv.  If a bug occurs only when some options set try to locate
351the option which triggers the bug.
352
353There is a script "reporter" in the subdirectory Util which will print out
354your current shell environment/setup.  If you cannot reproduce the bug
355with "zsh -f", use this script and include the output from sourcing this
356file.  This way, the problem you are reporting can be recreated.
357
358The known bugs in zsh are listed in the file Etc/BUGS.  Check this as
359well as the Frequently Asked Questions (FAQ) list before sending a bug
360report.  Note that zsh has some features which are not compatible with
361sh but these are not bugs.  Most of these incompatibilities go away
362when zsh is invoked as sh or ksh (e.g. using a symbolic link).
363
364If you send a bug report to the list and are not a subscriber, please
365mention this in your message if you want a response.
366
367If you would like to contribute to the development and maintenance of zsh,
368then you should join the zsh-workers mailing list (check the META-FAQ
369for info on this).  You should also read the "zsh-development-guide"
370located in the subdirectory Etc.
371
372Contributors
373------------
374
375The people who have contributed to this software project are listed
376in Etc/CONTRIBUTORS.
377