------------------------------------- CHANGES FROM PREVIOUS VERSIONS OF ZSH ------------------------------------- Note also the list of incompatibilities in the README file. Changes since 4.3.12 -------------------- There are no significant feature changes to the shell itself, although many bug fixes and improvements to functions. Changes since 4.3.11 -------------------- The zsh/parameter module has a new readonly associative array $usergroups whose keys are the names of system groups of which the current user is a member and whose values are the corresponding group identifiers. The region_highlight array, which controls highlighting of the command line from zle widgets, is now updated dynamically as the command line is edited. In POSIX emulation ("emulate sh") the shell is more accurate about when it should or should not exit on errors. The ${NAME:OFFSET:LENGTH} syntax now supports negative LENGTH, which counts back from the end of the string. The (g:opts:) flag in parameter expansion processes escape sequences like the echo and print builtins. opts can be any combination of o, e and c. With e, acts like print rather than echo except for octal escapes which are controlled separately by the o option. With c, interpret control sequences like "^X" as bindkey does. Regardless of the opts, \c is not interpreted. Changes between versions 4.3.10 and 4.3.11 ------------------------------------------ When the shell is invoked with the base name of a script, for example as `zsh scriptname', previous versions of zsh have used the name directly, whereas other shells use the value of $PATH to find the script. The option PATH_SCRIPT has been added to provide the alternative behaviour. This is turned on where appropriate in compatibility modes. Parameters, globbing, etc. -+-+-+-+-+-+-+-+-+-+-+-+-+ Parameter expansion has been enhanced to provide the ${NAME:OFFSET} and ${NAME:OFFSET:LENGTH} syntax for substrings and subarrays present in several other shells. OFFSET always uses zero-based indexing. The only clash with existing zsh syntax occurs if OFFSET begins with an alphabetic character or `&', which is not likely. The (D) flag in parameter expansion abbreviates directories in the substituted value. The (q-) flag does minimal shell quotation of arguments for maximum human readability of the result. The (Z) flag in parameter expansion is an enhanced version of the (z) flag that takes an argument indicating how the string to be split is treated. (Z:c:) parses comments as strings; (Z:C:) parses comments and strips them; (Z:n:) treats newlines as ordinary whitespace: (z) has always treated unquoted newlines as shell delimiters and turned them into semicolons, though this was not previously documented. Numeric expansion with braces has been extended so that a step may be given, as in {3..9..2}. The step may be negative as may the start and end of the range (this is also new). The glob qualifier P can be used to add a separate word before each match. For example, *(P:-f:) produces the command line `-f file1 -f file2 ...'. Regular expression matches now use the same variables for storing matched components as shell pattern matching. The function system now provides the function regexp-replace for replacing text using regular expressions. The zle widget functions replace-string, replace-string-again, if defined with regex in the name (e.g. "zle -N replace-regexp replace-string"), perform regular expression matches. In replacement text \& and \1 have the standard meaning. Line editor and completion -+-+-+-+-+-+-+-+-+-+-+-+-+ The completion system now has a style path-completion. Setting this to false inhibits completion of paths before the current path component, e.g. /u/b/z no longer completes to /usr/bin/zsh. This is useful on systems where this form of completion is pathologically slow due to network performance. With the MULTIBYTE option, the line editor now highlights bytes in the input that are not part of a valid character in the current locale in hex as for hex digits X; highlighting is controlled by the "special" keyword in the zle_highlight array. These can be distinguished from unprintable Unicode characters which also use "special" highlighting as the latter are always two or four bytes long, e.g. , . zle_highlight also controls highlighting of a removable completion suffix, e.g. the "/" automatically appended to directories. This uses the keyword "suffix". The line editor now sets the variable ZLE_LINE_ABORTED if there is an error when editing the line. The following code can be used to create a bindable editor widget to restore the aborted line: recover-line() { LBUFFER=$ZLE_LINE_ABORTED RBUFFER=; } zle -N recover-line and then either bind recover-line to a key sequence or use `M-x recover-line '. The parameter ZLE_STATE, available in user-defined line editor widgets, gives information on the state of the line editor. Currently this is whether the line editor is in insert or overwrite mode. Miscellaneous options -+-+-+-+-+-+-+-+-+-+- The new shell option HIST_LEX_WORDS causes history lines read in from a file to be split in the same way as normal shell lines, instead of simply on whitespace. It's an option as although the result is more accurate it can take a long time when the history size is large. The shell option MONITOR can be set in non-interactive shells, and also in subshells (as created by surrounding commands with parentheses), turning on job control for that subshell. The initial behaviour of a subshell is still to turn job control off, however if the new POSIX_JOBS option is set MONITOR remains active in subshells. The new shell option POSIX_CD, active in emulations of POSIX-based shells, makes the cd builtin POSIX-compatible. The POSIX_JOBS option already referred to has various other compatibility enchancements. The new shell option POSIX_STRINGS makes a null character in $'...' expansion terminate the string, as is already the case in bash. This is not particularly useful behaviour but may become a POSIX requirement. The new shell option POSIX_TRAPS causes the EXIT trap to behave in the same way as in other shells, i.e. it is only run when the shell exits. The new shell option SOURCE_TRACE causes the shell to report files containing shell code that the shell executes directly, i.e. startup files or files run with the `source' or `.' builtins. The shell option SUN_KEYBOARD_HACK has been supplemented by a more general mechanism: the KEYBOARD_HACK variable defines the character to be ignored. Add-on modules and function -+-+-+-+-+-+-+-+-+-+-+-+-+- The module zsh/system has a new "zsystem" builtin whose subcommands perform system level tasks. Currently "zsystem flock" performs advisory file locking (for aficionados, this uses the fcntl() system call so works over the network on Linux). This is a particularly convenient way of locking files for the length of a subshell. "zsystem supports flock" provides a test for this feature. There is now a function system for recording and restoring recently entered directories in a persistent fashion, with support in completion and (if explicitly installed) dynamic directory expansion. See the entry for cdr in the zshcontrib manual page. Changes between versions 4.3.9 and 4.3.10 ----------------------------------------- The command "emulate -c ..." evaluates an expression in a given emulation. The emulation is sticky for functions defined within the expression. The variable CORRECT_IGNORE gives a pattern that can be ignored in spelling correction. CORRECT_IGNORE='_*' ignores completion functions. The option POSIX_ALIASES improves compatibility of aliases with other shells. The variable ZSH_PATCHLEVEL can be used to test for unreleased versions of the shell; it is present but less useful in released versions. The variables ZLE_REMOVE_SUFFIX_CHARS and ZLE_SPACE_SUFFIX_CHARS allow more control over the way automatically removed suffixes are treated in completion. Major changes between versions 4.3.6 and 4.3.9 ---------------------------------------------- The option COMBINING_CHARS has been added. When it is set, the line editor assumes the terminal is capable of displaying zero-width combining characters (typically accents) correctly as modifications to the base character, and will act accordingly. Note it is not set by default owing to vagaries of terminals. The system is reported to work on MacOS, where this is particularly important as accented characters in file names are stored in their decomposed form (i.e. with base and combining characters). The option HIST_FCNTL_LOCK has been added to provide locking of history files using the system call fcntl(). On recent NFS implementations this may provide better reliability. The syntax ~[...] provides a dynamic form of directory naming, supplementing the existing static ~name syntax. A user-defined shell function, zsh_directory_name, is used to handle both expansion of names to directories and contraction of directories to names. Patterns can now be used in incremental searches with the new widgets history-incremental-pattern-search-backward and history-incremental-pattern-search-forward. These are not bound to keys by default. Highlighting and colouring of sections of the command line is now supported, controlled by the array parameter zle_highlight and the ZLE special parameter region_highlight. Colouring of prompts is now supported within the shell by prompt escapes. The prompt theme system has been updated. Various changes have been added to make debugging of shell code easier: - As noted in README, the option DEBUG_BEFORE_CMD is now set by default. - In DEBUG traps, $ZSH_DEBUG_CMD gives the code for which the trap is called as a string. - "setopt ERR_EXIT" in a DEBUG trap causes the code not to be executed. - $ZSH_SUBSHELL indicates the subshell level at which code is being executed. - The zsh/parameter module has various additional arrays similar to the existing $funcstack and $functrace, namely $funcsourcetrace and $funcfiletrace. The consistency and informativeness of the output of all these arrays has been improved. - Prompt escapes %x and %I show the source file and line number in debug prompts (compare %N and %i which show names and line numbers in the execution environment). - The option NO_MULTI_FUNCDEF can turn off multiple definition of functions at once, a rarely used feature that can cause problems with misplaced "()". - The "fc" builtin has been enhanced to make non-interactive use possible and output consistent when the history is manipulated with "print -s". The completion style accept-exact-dirs has been added. When true, this suppresses attempts to complete non-final directory segments of a filename path when the directory exists. (For example, /home/pws/src/zsh/ discovers that /home/pws/src/zsh exists and leaves the directory component alone, while /h/p/s/z/ completes to /home/pws/src/zsh/... as before.) This should improve completion behaviour noticeably in special cases, such as remote paths under Cygwin. Major changes between versions 4.3.5 and 4.3.6 ---------------------------------------------- cd, chdir, pushd and popd now take a -q option to suppress side effects including printing the directory stack (for pushd and popd) and executing the chpwd hook functions (for all four). The parameter subscript (e) flag now forces the argument to be treated as a string where it would previously have been treated as a pattern, for example ${array[(ie)*]} substitutes the index of the element whose value is "*". Major changes between versions 4.3.4 and 4.3.5 ---------------------------------------------- - The new extended globbing flag (#cN,M) behaves similarly to the extended regular expression syntax {N,M}. - The zsh/datetime module has been enhanced and a calendar function system has been added along the lines of (but much enhanced from) the traditional Unix "calendar" utility. This is still under development. See the zshcalsys manual. (The calendar functions were in 4.3.4 but were not listed in this file. There have been significant enhancements since 4.3.4.) - A new module zsh/curses provides a builtin zcurses for access to to the curses screen manipulation package. See the entry for zsh/curses in the zshmodules manual. - The module system has been enhanced to support the notion of "features" that give more control over which builtins, parameters, conditions and math functions are loaded from a module. In particular, "zmodload -F zsh/stat b:zstat" makes the builtin previously called "stat" available as "zstat" (only) to avoid clashes with a system command named "stat". Major changes between versions 4.2 and 4.3.4 -------------------------------------------- - There is support for multibyte character sets. This is now reasonably close to complete, although Unicode combining characters don't work properly. See Multibyte Character Support in INSTALL. - The shell can now run an installation function for a new user (a user with no .zshrc, .zshenv, .zprofile or .zlogin file) without any additional setting up by the administrator. See "THE ZSH/NEWUSER MODULE" in the zshmodules manual page. - The manual now has a Roadmap section (manual page zshroadmap) to give new users an indication of the most interesting parts of the manual. - New option PROMPT_SP (on by default): works around the problem that the line editor can overwrite output with no newline at the end. See the zshoptions manual page. - New option HIST_SAVE_BY_COPY (on by default): history is saved by copying and renaming instead of directly overwriting. See the zshoptions manual page. - New redirection syntax e.g. {myfd}>file opens a new file descriptor and stores the number in $myfd, so that >&$myfd will work. Chosen not to break existing code (and to be compatible with proposals for the Korn shell). See the section REDIRECTION in the zshmisc manual page. - Substitutions of the form ${var:-"$@"}, ${var:+"$@"} and similar where word-splitting is applied to the text after the :- or :+ (in particular, where the SH_WORD_SPLIT option is in effect for compatibility) now behave as in other Bourne- and POSIX-compatible shells when in the appropriate emulation mode. - New Posix-style zsh-specific tests [[:IDENT:]], [[:IFS:]], [[:IFSSPACE:]], [[:WORD:]] test if character can appear in identifier, is an IFS character, is an IFS whitespace character, or is considered as part of a word (is alphanumeric or appears in $WORDCHARS). These works correctly on multibyte characters if the appropriate support is present. See the section FILENAME GENERATION in the zshexpn manual page. - Time comparisons on files when sorting or using test operators will use high-resolution timestamps when available. This gives a resolution of a nanosecond instead of a second. - The idiom =(<<<...) is optimised so that the shell internally turns the ... into the contents of a file whose name is then substituted. The syntax has always been usable by means of the NULLCMD feature, but previously it generated an intermediate process; it has now been rewritten along the same lines as the optimisation for $(<...) that inserts a file into the command line without the use of an external programme. - Supplied functions catch and throw provide limited support for exception handling using the `{ ... } always { ... }' syntax. See the section EXCEPTION HANDLING in the zshcontrib manual page. - Signals now accept the SIG as part of the name for compatibility with other shells. - Editor function argument-base allows non-decimal arguments for editor widgets. See the entry in the zshzle manual page. - As always, there are many enhancements to completion functions. Changes in 4.2 since version 4.2.0 ---------------------------------- - The autoload and related builtins take options -k and -z to indicate ksh or zsh autoloading style for given functions, making it possible to mix and match. - Assignments to associative arrays can use the i and r index flags. For example, assoc[(i)alpha*]=bravo sets the value for the element whose key matches the pattern `alpha*'; assoc[(r)activ*]=passive sets the value for the element whose current value matches the pattern `activ*'. - The glob qualifier F indicates a non-empty directory. Hence *(F) indicates all subdirectories with entries, *(/^F) means all subdirectories with no entries. - fc -p and fc -P provide push/pop for the status of the shell's history (both internal and using the history file). With automatic scoping (fc -ap) it becomes easy to use a temporary history in a function. This has been added to the calculator function zcalc to make its internal history work more seamlessly. - A new `try block' and `always block' syntax has been introduced to make it easier to ensure the shell runs important tidy-up code in the event of an error. It also runs after a break, continue, or return, including a return forced by the ERR_RETURN option (but not an exit, which is immediate). The syntax is: `{' try-block-list `}' `always' `{' always-block-list `}' where no newline or semicolon may appear between `}' and `always'. This is compatible with all previous valid zsh syntax as an `always' at that point used to be a syntax error. For example, { echo Code run in current shell } always { echo Tidy-up code } - A new zle widget reset-prompt has been added to re-expand the current prompt. Changes to the variable in use as well as changes in its expansions are both taken into account. The same effect is now forced by a job change notification, making the %j prompt escape and %(j..) ternary expression more useful. - The zftp module supports ports following the hostname in the normal suffix notation, `host:port'. This requires IPv6 colon-style addresses to be specified in suitably quoted square brackets, for example: zftp open '[f000::baaa]' zftp open '[f000::baaa]:ftp' (the two are equivalent). - Special traps, those that don't correspond to signals, i.e. ZERR, DEBUG and EXIT are no longer executed inside other traps. This caused unnecessary confusion if, for example, both DEBUG and EXIT traps were set. The new behaviour is more compatible with other shells. - New option TRAPS_ASYNC which if set allows traps to run while the shell is waiting for a child process. This is the traditional zsh behaviour; POSIX requires the option to be unset. In sh/ksh compatibility mode the option is turned off by default and the option letter -T turns it on, for compatibility with FreeBSD sh. - New WIDGETSTYLE, WIDGETFUNC parameters in ZLE. - Glob qualifier (+func) is shorthand for (e:func:) (calls a command, typically a shell function, with no argument). New features between zsh versions 4.0 and 4.2 --------------------------------------------- Configuration: - upgraded to use autoconf post-2.50 - improved compatibility with other shells through shell options, builtin arguments and improved builtin option parsing Syntax and builtins: - new printf builtin - `+=' to append to parameters which works for scalars, arrays and (with pairs) associative arrays. - enhanced multiple parameter `for' loops: for key value in key1 value1 key2 value2 ... maintaining full compatibility with POSIX syntax. - Suffix aliases allow the shell to run a command on a file by suffix, e.g `alias -s ps=gv' makes `foo.ps' execute `gv foo.ps'. Supplied function zsh-mime-setup uses existing mailcap and mime.types files to set up suitable aliases. Supplied function pick-web-browser is suitable for finding a browser to show .html etc. files by suffix alias. - new option `no_case_glob' for case-insensitive globbing. Add-on modules and functions: - zsh/datetime modules makes date formatting and seconds since EPOCH available inside the shell. - zsh/net/tcp module provides builtin interface to TCP through ztcp builtin. Function suite for interactive and script use with expect-style pattern matching. - zsh/net/socket module provides zsocket builtin. - zcalc calculator function with full line editing. - builtin interface to pcre library - zsh/zselect module provides zselect builtin as interface to select system call Completion system: - general improvements to command and context support, low-level functions, display code. - in verbose mode, matches with the same description are grouped - highly configurable completions for values of specific parameters, specific redirections for specific commands - support for bash completion functions (typically zsh native functions are more powerful where available) - New completions provided for (some of these may be in later 4.0 releases): valgrind, tidy, texinfo, infocmp, Java classes, larch, limit, locale parameters, netcat, mysqldiff, mt, lsof, elinks, ant, debchange (dch), email addresses, file system types, Perforce, xsltproc. Plus many others. Line editor: - special parameters $PREDISPLAY, $POSTDISPLAY available in function widgets to configure uneditable text (for narrowing) - recursive editing - supplied widgets read-from-minibuffer, replace-string use these features (more intuitive prompting and argument reading than 4.0) - access to killed text via $CUTBUFFER and $killring - supplied highly configurable word widgets forward-word-match etc., can set what constitutes a word interactively or in startup script (implement bash-style behaviour, replacing previous bash-* word widgets) - interface to incremental search via $LASTSEARCH - better handling of keymaps in zle and widgets - better support for output from user-defined widgets while zle is active - tetris game which runs entirely in zle - several other contributed widgets Local internal improvements: - disowned jobs are automatically restarted - \u and \U print escapes for Unicode - read -d allows a custom line ending. - read -t . - line numbers in error messages and $PS4 output are more consistent - `=prog' expands only paths, no longer aliases for consistency - job display in prompts; `jobs' command output can be piped - prompts: new $RPROMPT2, %^, %j, %y, enhanced %{, %}, %_. - rand48() function in zsh/mathfunc for better randomness in arithmetic (if the corresponding math library function is present) - $SECONDS parameter can be made floating point via `typeset -F SECONDS' for better timing accuracy - improvements to command line history mechanism - job table is dynamically sized, preventing overflow (typically seen previously in complex completions). - many bugfixes New features in zsh version 4.0.1 --------------------------------- Compared with 3.1.9, there are mostly incremental improvements to - the new completion system --- more functions, completers, styles... - the line editor - handling of signals and traps - the configuration system, particularly for modules - Cygwin support (now essentially complete) - arithmetic evaluation - the zpty (pseudoterminal handling) module - the test suite plus various bug fixes and compatibility improvements. The alias modules (zle.so as an alias for zsh/zle.so, etc.) have been removed; use `zmodload -A' to load modules under other names. This is irrelevant if you are upgrading from 3.0. Compared with the 3.0 series of releases (the last stable set), the most significant of a large number of improvements in the shell are: - Dynamically loadable modules with hierarchical naming system - Shell functions as editor functions, with much additional builtin support - Incredibly rich new completion system; just needs a single initialization command to provide completion for all sorts of commands and contexts - Associative arrays - Lots of new features in parameter substitution and globbing; more logical handling of nested parameter substitutions - Rewritten pattern-matching (globbing) code supports approximate and case-insensitive matching and backreferences - Various custom modules for pty's, FTP, special parameters, etc. - Rewrites of many internal parts of the code: execution code to provide compilation to internal representation, pattern matching - Floating point arithmetic and mathematical functions module - A test suite - Various new options for compatibility with this, that and the other See the 3.1.x changes below for more detail. New features in zsh version 3.1.8 and 3.1.9 ------------------------------------------- These are primarily bug-fix versions. There are only a few user-visible changes. - Array slices ${array[a,b]} with b < a now correctly have zero length. New features in zsh version 3.1.7 --------------------------------- Further enhancements to new completion system: - Comprehensive context-sensitive configuration via `styles', which can be set by the menu-driven front end in compinstall - General mechanism for setting patterns to be ignored in a completion; overriding of patterns to be matched for functions - New completers: _prefix to complete word before cursor, _ignored to complete using words so far ignored (like $fignore but more powerful), _history to complete words from shell history - Multiple use of completers with different options, similarly splitting of different types of completion (`tags') so they are considered with different styles - Many more supplied completions for standard commands which work out of the box, and better handling of command line options/arguments which behave in the usual way - $fpath now set up to use installed functions by default; functions can be loaded just by `autoload -U compinit; compinit' - Much improved handling of nested quoting and nested braces - New LIST_PACKED and LIST_ROWS_FIRST completion options and corresponding styles - compctl library separated out (frozen but still supported) - User-friendly introduction available at zsh website http://zsh.sourceforge.net/ Additions to complist listing library (coloured completion and menu selection): - Listings can be shown page by page (are by default for new completion) - Menu selection allows full up and down scrolling of long lists Other editing features: - new parameters $PENDING, $MARK, $BUFFERLINES - Easy display of a prompt from within an editing widget Code parsing, storing and execution: - Completely new system of storing code internally, greatly optimised - Much less memory for shell functions etc. - Can compile shell functions to .zwc `wordcode' functions for fast loading - Can create `digest' files of entire directories in .zwc format Parameters: - Floating point support added, similar to ksh93, `typeset -F' and `typeset -E' declare floating point variables; usual C/Fortran-like rules for integer/float conversion - Mathematical library zsh/mathfunc contains all the standard mathematical functions for use in arithmetical expressions - Improved parsing of arithmetical expressions and better error messages - Special parameters can be made local - `typeset -h' hides specialness of parameters, either as parameter attribute or when declaring new local variable - Local parameters can now be exported as in other shells; new option GLOBAL_EXPORTS on by default provides old behaviour that `typeset -x' referred to global parameters. - zsh/parameter module enhanced: now needed for new completion; parameters provided have `-h' flag set so that they are hidden by `typeset', so that existing functions don't need to be changed - Quotes can be stripped from parameter values with ${(Q)...}, providing reverse of ${(q...)...} facility Globbing and pattern matching: - Pattern matching rewritten for efficiency - Supports `backreferences', i.e. extracting parenthesised chunks of matches, e.g. [[ $foo = (#b)(*/)[^/]* ]] stores the part of $foo up to the last / in $match[1] and the indexes of the match in $mbegin[1], $mend[1]. (#m) is also available to set $MATCH to the entire match and corresponding $MBEGIN, $MEND: useful in parameter substitutions like ${.../.../...}. - (#s) and (#e) match start and end of pattern like ^ and $ in regular expression, useful in complex expressions such as ((#s)|/)dirname((#e)|/) and in parameter expressions. - Depth-first/last listing of recursive glob lists Functions etc.: - `autoload -X' inside a function body instructs the shell to bootstrap the function at that point - `autoload +X fn' says load the function fn but don't execute it - Prompt `themes' make customization of prompts easier Modules: - New hierarchical naming scheme for modules; supplied modules go into zsh subdirectory, so zle becomes zsh/zle etc.; aliases supplied for compatibility for existing code, but the new format should be used in future. - zmodload is more consistent between dynamically and statically linked shells - zsh/zftp and its function suite support multiple sessions (zfsession command); zftransfer allows transfer of files between two ftp sessions with no local file; use styles for e.g. progress style; IPv6 supported; recursive put `zfput -r' for uploads - zsh/zpty module creates pseudoterminal and allows builtin `expect'-like behaviour Other: - Test suite, not yet complete (`make test') - use of Linux task limits - Many fixes including output redirection with `setopt xtrace' and other redirection fixes; NIS+ problem. - Better null-command behaviour in sh and csh emulation - Internal memory usage optimisations New features in zsh version 3.1.6 (beta version) ------------------------------------------------ Note also the changes for 3.0.6, which include changes between 3.1.5. and 3.1.6. New completion system via shell functions; massive degree of programmability and configurability: - ready-made function suite to use, see zshcompsys(1) - approximate completion and spelling correction via completion - control over matching for case-independence, partial word completion, etc. - menu selection: choose a completion by moving the cursor - coloured completion lists - completion of filenames in quotes is now more reliable; splitting quoted strings into command arguments is also possible. Other editing changes: - enhancements to function/editing interface: new parameters, numeric arguments, string argument passing, reading keys from widgets. - the old history-search-{back,for}ward behaviour and bindings have returned (up to minor details). - BASH_AUTO_LIST option to show completion list only on second key press. - the ZBEEP parameter gives a string to output instead of beeping, allowing you to have a visual bell. History changes: new options HIST_NO_FUNCTIONS, HIST_EXPIRE_DUPS_FIRST, HIST_FIND_NO_DUPS, HIST_IGNORE_ALL_DUPS, INC_APPEND_HISTORY, HIST_SAVE_NO_DUPS, SHARE_HISTORY, allow better control of when history is read and written and how duplicates are handled. New format for history saves. Associative arrays plus enhanced parameter substitutions to retrieve keys and values. Globbing changes: - Case-insensitive and approximate globbing. - Ordering and indexing of globbing matches, e.g. *(om[1]) picks most recently modified file. - General file mode qualifier with chmod(1)-like syntax, e.g. *(f:u+wx:) New loadable modules: - zftp, plus associated function suite, for turning your zsh session into an FTP session too - parameter, for examining and altering shell hash tables via an associative array interface. - mapfile, for reading and writing external files via an associative array interface. Debugging and prompt enhancements: - $PS4 can contain %i for $LINENO as well as %N for script or function names (default PS4 changed), also %_ for current shell structure executing; - Prompt truncation %<...< is now more flexible: it applies to a whole section of the prompt, not just one escape. You need to put %<< after the truncated escape to get the old behaviour. - %20(l.yes.no) in prompts prints yes if at least 20 characters have been output, else no (e.g. for outputting extra newlines). Parameter and expansion changes - `typeset -t MYPATH mypath' creates tied path/PATH-like variables - `typeset -g' allows operations on parameters without making them local - New expansions - ${(t)param} prints type information for $param - ${(P)param} treats value of $param as the name of a param to substitute - ${foo:q} can quote replaced parameter text from expansion - ${foo/old/new} substitution, like bash; also (S) flag for shortest match - $foo[(b.2.i)bar] starts searching $foo for bar starting at 2nd match Builtin and function changes - stat module: `stat -H hash foo' gives you e.g. $hash[mtime] - `autoload -U' autoloads functions without alias expansion. Other new options: - LOCAL_TRAPS allows signal traps to be local to functions (as in ksh). - NO_RCS can now be turned on at any point in initialization files. - NO_GLOBAL_RCS can force /etc/z* files after /etc/zshenv to be skipped. (Please don't use this as an excuse to stuff more into /etc/zshenv!) - Existing MAGIC_EQUAL_SUBST option is more useful; any argument containing ...=~...:~... will perform filename expansion on the ~ (previously, the string before `=' had to look like a parameter name). Configuration changes: - Generation of signal names should be more reliable - Customizable installation of shell functions from distribution. New features in zsh version 3.0.6 --------------------------------- Most of these changes are designed to improve compatibility with zsh version 3.1.6, the latest development release. However, this release also fixes all known Year 2000 (Y2K) bugs in zsh 3.0. History changes: - whitespace between words is ignored in history searches. - new option HIST_REDUCE_BLANKS removes extra whitespace in the stored history. - support for reading (but not writing) version 3.1.6 history files. Globbing changes: - the a, c, and m glob qualifiers can now test time in seconds. - globbing of number ranges behaves more like character ranges in that it can match a prefix of a number, e.g. `<1-5>*' matches 1, 2, 3, 4, 5, 17, 23skiddoo, 5986, etc., but not 6, 7, 8ball, 911, etc. Parameter and expansion changes: - expansion of ~ and other globbing flags via ${~param} do not depend upon EXTENDED_GLOB (bug fix). - nested parameter substitutions require braces (this was always the documented behavior, but previous parsers didn't enforce it). - quote only nested expansion, e.g. ${(f)"$(&file' is a redirection, not a NULLCMD. - any single complex command, such as `case ... esac', parses as if semicolon-terminated (bug fix). - the shell function `preexec', if defined, is run after parsing each command line but before executing the command. Other changes: - the option PRINT_EIGHT_BIT causes zsh to emit raw bytes in prompts and completion lists even if the system ctype(3) package says that those bytes are not "printable." Debugging enhancements: - LINENO is now very much more useful in scripts and functions and is reported correctly in most error messages. - ERREXIT behavior is now consistent with newer Bourne-like shells, e.g. with respect to `if' tests that fail. Configuration changes: - Large file and 64-bit integers on 32-bit machines supported where provided by OS. - a few more system features, such as getpwnam/getpwuid, are tested for. New features in zsh version 3.1 (beta version) ---------------------------------------------- On most operating systems zsh can load binary modules dynamically at run-time. ZLE and the compctl builtin are now reside in a separate module which is loaded automatically on demand. for ((expr; expr; expr)) do ... done loop syntax from AT&T ksh93 is now supported. POSIX globbing character classes ([:alnum:] etc.) are now supported. ksh's case fall-through feature (;&) is supported. ksh93's $'' quoting syntax is supported. Restricted mode is now supported. This is controlled by the new option RESTRICTED (-r). New options BARE_GLOB_QUAL, HIST_NO_FUNCTIONS (alias NO_LOG), KSH_GLOB, PRINT_EIGHT_BIT, PROMPT_BANG, PROMPT_PERCENT, RM_STAR_WAIT. Options ALWAYS_LAST_PROMPT, APPEND_HISTORY, AUTO_LIST, AUTO_MENU, AUTO_PARAM_KEYS, AUTO_PARAM_SLASH, AUTO_REMOVE_SLASH, LIST_AMBIGUOUS and LIST_TYPES are now on by default. In ZLE, arbitrarily many keymaps can be defined. Multi-character keybindings now work. Completion can be performed within a brace expansion. EMACS-like universal-argument function. New features in zsh version 3.0 ------------------------------- Trailing "/" in a glob pattern now works like in other shell thus it can no longer be used as a shorthand for "(/)". Much improved sh/ksh emulation. When zsh is invoked as sh it mostly conforms to POSIX 1003.2. Enhanced parameter expansion features: new flags: A, @, e, W, p, f, F. Expansions can be nested. For example, "${${(M)${(f@)$( is a redirection operator which opens the standard input for both reading and writing. To match a number use <->. Option letters -1 and -C for PRINT_EXIT_VALUE and NO_CLOBBER are swapped: `set -C' sets NO_CLOBBER and `set -1' sets PRINT_EXIT_VALUE. AUTO_PUSHD behaviour is changed. Now cd without arguments will always go to the $HOME directory even if AUTO_PUSHD is set and PUSHD_TO_HOME is not set. If you preferred the old behaviour you can alias cd to pushd. IFS word splitting with SH_WORD_SPLIT and the splitting of the input in the read builtin has changed in cases when IFS contains characters other than , , . See the description of IFS in the zshparam manual page for more details. New features in zsh version 2.5 ------------------------------- Greatly expanded completion possibilities. Programmable completion allows detailed control over what arguments of what commands can be completed to what. See dots/zcomp in the distribution for examples. Expand filenames with ~ and = on the right hand side of parameter assignments. New option MAGIC_EQUAL_SUBST to do it in all identifier=expression arguments. ${+name} becomes 1 or 0 if name is set or unset. ${~spec} toggles GLOB_SUBST in substitution. Parameter substitution takes lots of flags in the format ${(flags)name}. New glob qualifiers for block/character special files, times in glob qualifiers can be in months, weeks, days, hours, minutes. Qualifiers can work on links or on what they point to. Qualifiers separated by commas are or-ed. New parameter substitution modifiers (fFwW) to repeat actions. New option CSH_JUNKIE_HISTORY. New line editor functions history-beginning-search-backward, history-beginning-search-forward, expand-or-complete-prefix, push-input, push-line-or-edit. Assign to part of a string, use qualifiers on string subscription with $foo[(qual)2,5] New parameters: EGID, EUID, KEYTIMEOUT New prompt escape sequence %_ to get constructs like for and while in the secondary prompt. %E in prompt clears to end of screen. Conditional expressions in PROMPT and WATCHFMT. New options ALWAYS_LAST_PROMPT, ALWAYS_TO_END, AUTO_PARAM_KEYS, COMPLETE_ALIASES, COMPLETE_IN_WORD, CSH_JUNKIE_HISTORY, GLOB_SUBST, LIST_AMBIGUOUS, MAGIC_EQUAL_SUBST, NO_FLOW_CONTROL, PROMPT_SUBST New option -m to many builtins makes arguments subject to pattern matching. Bindkey can now bind both key sequences and prefixes of those. You can for example bind ESC and function keys sending ESC sequences. Additional options to read builtin to use in functions called by completion. New options to print to sort arguments and print them in columns. Some additional resource limits can be specified. Some editor functions now work in the minibuffer.