1------------------------------------- 2CHANGES FROM PREVIOUS VERSIONS OF ZSH 3------------------------------------- 4 5Note also the list of incompatibilities in the README file. 6 7Changes since 5.0.0 8------------------- 9 10Numeric constants encountered in mathematical expressions (but not other 11contexts) can contain underscores as separators that will be ignored on 12evaluation, as allowed in other scripting languages. For example, 130xFFFF_FFFF, or 3.141_592_654. 14 15"functions -T" turns on tracing for the specified function(s) only, 16similar to "functions -t" except that tracing is turned off for any 17functions called from the specified one(s) that don't also have the -t 18or -T flag. 19 20The option FORCE_FLOAT has been added to force all arithmetic constants 21to be treated as floating point. This is most useful locally within 22functions or scripts performing floating point calculations. 23 24Individual pattern characters can be disabled. For example, to allow '^' 25to be an ordinary character even if the option EXTENDED_GLOB is set, use 26"disable -p '^'". 27 28The variable editing builtin vared can be given custom editing widgets 29for initialisation and finishing. 30 31The line editor's capability for listening on file descriptors 32additional to the terminal has been enhanced so that the handler for 33such file descriptors can be a line editor widget. Previously the 34handler always behaved as a standard shell function. 35 36Hooks for adding history (the function zshaddhistory and the 37array zshaddhistory_functions) can return status 2 to indicate that 38history is to be saved internally within the shell but not written. 39 40In file completion, the recursive-files style can be set to an array of 41patterns to match against "$PWD/". In any matched location, it is 42possibly to complete files in arbitrarily deep subdirectories without 43needing to type the directory prefix. See example in the zshcompsys 44manual. 45 46The _user_expand completer now allows expansion functions in the 47user-expand files to return a string in REPLY that will be used to name 48the set of expansions returned. 49 50The parameter HISTORY_IGNORE may be set to a pattern which matches 51lines in the internal history that are to be omitted from the history 52file at file write time. This differs from history changes made in 53the zshaddhistory hook or by the HIST_IGNORE_* options, all of which 54take effect immediately on the internal history list itself. 55 56The parameter ZLE_RPROMPT_INDENT can be set to 0 to remove the space 57between the right hand side of the screen (this causes problems with 58some terminals). It is not special and is not set by default; the 59effect in that case is as if it was 1, as in previous versions. 60 61 62Changes between 4.2 and 5.0.0 63----------------------------- 64 65The following changes first appeared in the 4.3 series of releases; 66see also the file Etc/NEWS-4.3. 67 68Here is a summary of the most significant changes: 69 70- Multibyte characters strings are supported throughout the shell. 71 Various options, editor features, and expansion flags have been 72 added to aid in using them. 73 74- The following new options have appeared: COMBINING_CHARS, 75 DEBUG_BEFORE_CMD, HASH_EXECUTABLES_ONLY, HIST_FCNTL_LOCK, 76 HIST_LEX_WORDS, HIST_SAVE_BY_COPY, MULTIBYTE, NO_MULTI_FUNCDEF, 77 PATH_SCRIPT, POSIX_ALIASES, POSIX_CD, POSIX_JOBS, POSIX_STRINGS, 78 POSIX_TRAPS, PROMPT_SP, SOURCE_TRACE. 79 80- Highlighting and colouring of the command line is supported. 81 82- Job control is supported in non-interactive shells and subshells. 83 84- The zshroadmap manual page provides a slightly more helpful 85 introduction to the shell manual than was previously available. 86 87- There have been some notable enhancements to POSIX comptability 88 when the shell is in a corresponding emulation (e.g. "emulate sh"). 89 90Expansion (parameters, globbing, etc.) and redirection 91-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 92 93- The character group tests [[:IDENT:]], [[:IFS:]], [[:IFSSPACE:]], 94 [[:WORD:]] in patterns allow testing if a character can be 95 part of an identifier, is an IFS character, is an IFS whitespace 96 character, or is considered part of the word using the line editor's 97 logic based on the shell variable WORDCHARS. 98 99- In extended globbing, "(#cN,M)" means "match the preceding group 100 at least N but no more than M times". 101 102- The glob qualifier P can be used with an argument to add an extra 103 word before each glob match. 104 105- The syntax ~[...] provides dynamic directory naming by means 106 of the shell function zsh_directory_name or associated hook functions. 107 This is useful for expanding paths with many variable components as 108 commonly found in software development. 109 110- Parameter substitution has the ${NAME:OFFSET} and ${NAME:OFFSET:LENGTH} 111 syntax for compatibility with other shells (and zero-based indexing 112 is used to enhance compatibility). LENGTH may be negative to count 113 from the end. 114 115- The arbitrary limit on parameter subscripts (262144) has been removed. 116 As it was not configurable and tested in an inconvenient place it 117 was deemed preferable to remove it completely. The limit was originally 118 introduced to prevent accidental creation of a large parameter array 119 by typos that generated assignments along the lines of "12345678=0". 120 The general advice is not to do that. 121 122- The parameter substitution flag (D) abbreviates directories in parameters 123 using the familiar ~ form. 124 125- The parameter substitution flag (g) can take delimited arguments o, e and 126 c to provide echo- and print-style expansion: (g::) provides basic 127 echo-style expansion; (g:e:) provides the extended capabilities of 128 print; (g:o:) provides octal escapes without a leading zero; (g:c:) 129 additionally expands "^c" style control characters as for bindkey. 130 Options may be combined, e.g. (g:eoc:). 131 132- The parameter substitution flag (m) indicates that string lengths used 133 calculated by the (l) and (r) flags or the # operator should take 134 account of the printing width of characters in multibyte mode, whether 135 0, 1 or more. (mm) causes printing characters to count as 1 and 136 non-printing chracters to count as 0. 137 138- The parameter substitution flag (q-) picks the most minimal way of 139 quoting the parameter words, to make the result as readable as possible. 140 141- The parameter substitution flag (Z), a variant of (z), takes arguments 142 describing how to split a variable using shell syntax: (Z:c:) parses 143 comments as strings (the default is not to treat comment characters 144 specially); (Z:C:) parses comments and strips them; (Z:n:) treats 145 newlines as ordinary whitespace (the default is to turn unquoted 146 newlines into semicolons; this is now documented). 147 148- The parameter subscript flag (e) forces the argument to be treated 149 as a string, never a pattern, e.g. ${array[(ie)*]} looks for the 150 index of the array element containing the literal string "*". 151 152- The operators :| and :* in parameter substitution allow for array 153 subtraction and intersection in the form ${name:|array}. With the :| 154 operator, all entries in $name that are also in $array will be removed 155 from the substitution. Conversely for the :* operation only the 156 entries that are in both arrays will be substituted. 157 158- Numeric expansions can have a positive or negative step 159 e.g. "{3..9..2}". Negative start and end of ranges are also now 160 supported. 161 162- =(<<<...) is optimised to eliminate the need for an external process. 163 It writes the given string to a file and substitutes the name on the 164 command line. 165 166- The redirection operations "{myfd}>file" and "{myfd}>&-" open and 167 close a new file descriptor (at least 10) contained in the shell 168 variable myfd, which can be written to with ">&$myfd". This allows 169 arbitrary file descriptors rather than the explicit range 0 to 9. 170 171- New prompt escapes: 172 %x and %I show source file and line number, useful in $PS4 (the 173 existing %N and %i show names and lines in the execution environment 174 rather than the source file). 175 %F, %K, %f, %k allow colouring of prompts both using ANSI colour names 176 and values supported by individual terminal emulators. 177 178Builtins and shell functions 179-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 180 181- Directory-changing builtins take an option -q to suppress side 182 effects such as printing directories or calling the chpwd hook functions. 183 184- Various enhancements have been made to traps: 185 - The option DEBUG_BEFORE_CMD is on by default, so DEBUG traps 186 can be used to debug code about to be run 187 - $ZSH_DEBUG_CMD in such a trap gives the code to be run 188 - "setopt ERR_EXIT" in a DEBUG trap causes the code not to be executed 189 190- The "fc" builtin is now more useful non-interactively. 191 192Shell variables (parameters) 193-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 194 195- New variables: 196 CORRECT_IGNORE can be set to a pattern to be ignored in spelling correction. 197 KEYBOARD_HACK defines characters to be ignored if typed unmatched at 198 the end of the line (an extension of the SUN_KEYBOARD_HACK option, 199 but note that setting the option will override the variable). 200 ZSH_PATCHLEVEL provides a unique indication of the code compiled to 201 make the shell, even between releases. 202 ZSH_SUBSHELL indicates the subshell level, incremented once per fork, at 203 which the code is being run. 204 205Options 206-+-+-+- 207 208- New options: 209 COMBINING_CHARS: assume that the terminal displays combining 210 characters correctly. The shell cannot determine this by itself, 211 hence the option. This is highly recommended for MacOS X where 212 file names are stored with accented characters split into basic 213 and combining characters. 214 DEBUG_BEFORE_CMD (on by default): execute debug traps before the 215 code they refer to. This is a change of the default behaviour 216 as the new behaviour is much more useful. 217 HASH_EXECUTABLES_ONLY: don't insert non-executable files into the 218 command hash used e.g. by completion; this is optional as the 219 resulting behaviour may be very slow on network paths. 220 HIST_FCNTL_LOCK: Use the system's file locking mechanism instead 221 of an ad-hoc mechanism for locking history files. 222 HIST_LEX_WORDS: Perform lexical analysis on history lines read from 223 files, so the words are more accurately determined. May be very slow. 224 HIST_SAVE_BY_COPY (on by default): if unset, write a history file in 225 place by truncating the old one. Only needs to be turned off in 226 special circumstances. 227 MULTIBYTE (on by default if available): both variables and editor 228 command lines are treated as sequences of multibyte characters 229 rather than raw bytes depending on the locale. May be turned off 230 within functions to perform bytewise operations. 231 MULTI_FUNCDEF (on by default): "foo bar () { ... }" defines two 232 functions. This is often found to be confusing and bug-prone, 233 so you may want to unset it. 234 PATH_SCRIPT: search the path for a script specified as the first 235 argument to the shell on invocation. 236 POSIX_ALIASES: reserved words are not candidates for alias expansion. 237 POSIX_CD: make directory changing more POSIX-compatible. 238 POSIX_JOBS: make job control more POSIX compliant. 239 POSIX_STRINGS: $'...\0...' always processes \0 as a NULL, but if the 240 option is set the remainder of the string is ignored. 241 POSIX_TRAPS: EXIT traps are not executed on return from shell functions. 242 PROMPT_SP: improves display of lines not ending with newlines when 243 PROMPT_CR is in effect. 244 SOURCE_TRACE: print information as files are executed with ".", 245 "source", or as startup or shutdown files. 246 247Line editor 248-+-+-+-+-+- 249 250- Supports multibyte characters, including characters wider than one 251 screen cell and (with the COMBINING_CHARS option) combining characters. 252 253- New builtin widgets: 254 arguments-base: allow non-decimal numeric arguments 255 history-incremental-pattern-search-{backward,forward}: support 256 patterns in incremental searches. 257 258- New special variables: 259 region_highlight allows arbitrary highlighting of parts of the 260 command line; it is maintained dynamically. 261 UNDO_CHANGE_NO gives a unique record of the current change state of 262 the command line, for undoing back to a particular point using 263 the undo widget. 264 zle_highlight provides master control of highlighting for special 265 modes, e.g. unprintable characters. 266 ZLE_LINE_ABORTED records an editor line that was aborted by an error 267 or C-g. It can be used to recover aborted lines. 268 ZLE_STATE give miscellaneous information, currently whether the line 269 editor is in insert or overwrite mode. 270 271- The undo widget takes an argument, a previous value of $UNDO_CHANGE_NO. 272 273Completion 274-+-+-+-+-+ 275 276- Many new and enhanced completion functions 277 278- New styles: 279 accept-exact-dirs: suppress path expansion of directory components 280 that already exist, speeding up completion significantly on slow 281 network directories. 282 path-completion: can be used to suppress directory components before 283 the current one completely, so e.g. /u/b<TAB> only completes after the 284 "b", not the "u". 285 286- New special variables: 287 ZLE_REMOVE_SUFFIX_CHARS, ZLE_SPACE_SUFFIX_CHARS provide enhanced 288 flexibility over suffix removal. 289 290- Matching control, typically handled with the matcher-list style, 291 supports named character ranges, such as [:upper:], wherever 292 ranges were allowed, for example 'm:{[:upper:]}={[:lower:]}'. 293 However, matching control does not yet handle multibyte characters 294 properly, so this is currently limited to ASCII. 295 296Syntax and compatibility 297-+-+-+-+-+-+-+-+-+-+-+-+ 298 299- Substitutions of the form ${var:-"$@"} and ${var:+"$@"} now behave 300 much more like other shells when appropriate (e.g. with the 301 SH_WORD_SPLIT option). 302 303- Assignments within variable substitutions, such as ${var=value}, 304 are also more compatible with other shells where appropriate. 305 306- The emulate command can now be passed an expression to be evaluated 307 in a "sticky" emulation, so that functions defined there always 308 behave in the appropriate emulation. 309 310- "emulate sh" and similar modes have improved compatibility with 311 respect to deciding whether the shell should exit on errors. 312 313- Signals now accept SIG as part of the name. 314 315Modules 316-+-+-+- 317 318- Modules now present "features", specific builtins (b:), parameters 319 (p:), conditions (c:) and math functions (f:), allowing more control 320 over what is imported from a module. 321 322- The zsh/curses module provides access to the "curses" screen 323 manipulation package. 324 325- The zsh/datetime module has a calendar utility, although it is not 326 as robust as standalone calendar utilities. 327 328- The zsh/newuser module and associated functions has facilities for 329 setting up startup files for a first-time user. 330 331- The zsh/parameter module contains some new arrays to aid in tracing 332 of the shell's call stack: $funcsourcetrace and $funcfiletrace. 333 334- The zsh/parameter module provides $usergroups, an associative arrays 335 whose keys are the names of groups the current user belongs to, with 336 the group identifier as the corresponding value. 337 338- The zsh/system module has a zsystem builtin which provides file 339 locking and also a forward-compatible means for testing subcommands 340 supported. 341 342Internal improvements 343-+-+-+-+-+-+-+-+-+-+- 344 345- High resolution timestamps are used internally for certain 346 comparisons when available. 347 348Add-on functions 349-+-+-+-+-+-+-+-+ 350 351- The VCS_Info system provides a way of keeping track of the state 352 of numerous version control systems within the shell. 353 354- cdr etc.: change to a directory from a list that persists between 355 shell instances, with completion support. 356 357- regexp-replace replaces text in variables using regular expressions; 358 it may be used by zle function widgets based on the functions 359 replace-string and replace-string-again to provide regular expression 360 replacements in the line editor. 361 362 363Changes in 4.2 since version 4.2.0 364---------------------------------- 365 366- The autoload and related builtins take options -k and -z to indicate 367 ksh or zsh autoloading style for given functions, making it possible 368 to mix and match. 369 370- Assignments to associative arrays can use the i and r index flags. 371 For example, 372 assoc[(i)alpha*]=bravo 373 sets the value for the element whose key matches the pattern `alpha*'; 374 assoc[(r)activ*]=passive 375 sets the value for the element whose current value matches the pattern 376 `activ*'. 377 378- The glob qualifier F indicates a non-empty directory. Hence *(F) 379 indicates all subdirectories with entries, *(/^F) means all 380 subdirectories with no entries. 381 382- fc -p and fc -P provide push/pop for the status of the shell's 383 history (both internal and using the history file). With automatic 384 scoping (fc -ap) it becomes easy to use a temporary history in a 385 function. This has been added to the calculator function zcalc to make 386 its internal history work more seamlessly. 387 388- A new `try block' and `always block' syntax has been introduced 389 to make it easier to ensure the shell runs important tidy-up code 390 in the event of an error. It also runs after a break, continue, or 391 return, including a return forced by the ERR_RETURN option 392 (but not an exit, which is immediate). The syntax is: 393 `{' try-block-list `}' `always' `{' always-block-list `}' 394 where no newline or semicolon may appear between `}' and `always'. 395 This is compatible with all previous valid zsh syntax as an `always' 396 at that point used to be a syntax error. For example, 397 { echo Code run in current shell } always { echo Tidy-up code } 398 399- A new zle widget reset-prompt has been added to re-expand the current 400 prompt. Changes to the variable in use as well as changes in its 401 expansions are both taken into account. The same effect is now forced by 402 a job change notification, making the %j prompt escape and %(j..) ternary 403 expression more useful. 404 405- The zftp module supports ports following the hostname in the normal suffix 406 notation, `host:port'. This requires IPv6 colon-style addresses to be 407 specified in suitably quoted square brackets, for example: 408 409 zftp open '[f000::baaa]' 410 zftp open '[f000::baaa]:ftp' 411 412 (the two are equivalent). 413 414- Special traps, those that don't correspond to signals, i.e. ZERR, DEBUG 415 and EXIT are no longer executed inside other traps. This caused 416 unnecessary confusion if, for example, both DEBUG and EXIT traps 417 were set. The new behaviour is more compatible with other shells. 418 419- New option TRAPS_ASYNC which if set allows traps to run while the 420 shell is waiting for a child process. This is the traditional zsh 421 behaviour; POSIX requires the option to be unset. In sh/ksh 422 compatibility mode the option is turned off by default and the option 423 letter -T turns it on, for compatibility with FreeBSD sh. 424 425- New WIDGETSTYLE, WIDGETFUNC parameters in ZLE. 426 427- Glob qualifier (+func) is shorthand for (e:func:) (calls a command, 428 typically a shell function, with no argument). 429 430 431New features between zsh versions 4.0 and 4.2 432--------------------------------------------- 433 434Configuration: 435- upgraded to use autoconf post-2.50 436- improved compatibility with other shells through shell options, 437 builtin arguments and improved builtin option parsing 438 439Syntax and builtins: 440- new printf builtin 441- `+=' to append to parameters which works for scalars, arrays and (with 442 pairs) associative arrays. 443- enhanced multiple parameter `for' loops: 444 for key value in key1 value1 key2 value2 ... 445 maintaining full compatibility with POSIX syntax. 446- Suffix aliases allow the shell to run a command on a file by suffix, 447 e.g `alias -s ps=gv' makes `foo.ps' execute `gv foo.ps'. Supplied 448 function zsh-mime-setup uses existing mailcap and mime.types files 449 to set up suitable aliases. Supplied function pick-web-browser is 450 suitable for finding a browser to show .html etc. files by suffix alias. 451- new option `no_case_glob' for case-insensitive globbing. 452 453Add-on modules and functions: 454- zsh/datetime modules makes date formatting and seconds since EPOCH 455 available inside the shell. 456- zsh/net/tcp module provides builtin interface to TCP through ztcp 457 builtin. Function suite for interactive and script use with expect-style 458 pattern matching. 459- zsh/net/socket module provides zsocket builtin. 460- zcalc calculator function with full line editing. 461- builtin interface to pcre library 462- zsh/zselect module provides zselect builtin as interface to select 463 system call 464 465Completion system: 466- general improvements to command and context support, low-level functions, 467 display code. 468- in verbose mode, matches with the same description are grouped 469- highly configurable completions for values of specific parameters, 470 specific redirections for specific commands 471- support for bash completion functions (typically zsh native functions are 472 more powerful where available) 473- New completions provided for (some of these may be in later 4.0 474 releases): valgrind, tidy, texinfo, infocmp, Java classes, larch, limit, 475 locale parameters, netcat, mysqldiff, mt, lsof, elinks, ant, debchange 476 (dch), email addresses, file system types, Perforce, xsltproc. 477 Plus many others. 478 479Line editor: 480- special parameters $PREDISPLAY, $POSTDISPLAY available in function 481 widgets to configure uneditable text (for narrowing) 482- recursive editing 483- supplied widgets read-from-minibuffer, replace-string use these features 484 (more intuitive prompting and argument reading than 4.0) 485- access to killed text via $CUTBUFFER and $killring 486- supplied highly configurable word widgets forward-word-match etc., can 487 set what constitutes a word interactively or in startup script 488 (implement bash-style behaviour, replacing previous bash-* word widgets) 489- interface to incremental search via $LASTSEARCH 490- better handling of keymaps in zle and widgets 491- better support for output from user-defined widgets while zle is active 492- tetris game which runs entirely in zle 493- several other contributed widgets 494 495Local internal improvements: 496- disowned jobs are automatically restarted 497- \u and \U print escapes for Unicode 498- read -d <delimiter> allows a custom line ending. 499- read -t <timeout>. 500- line numbers in error messages and $PS4 output are more consistent 501- `=prog' expands only paths, no longer aliases for consistency 502- job display in prompts; `jobs' command output can be piped 503- prompts: new $RPROMPT2, %^, %j, %y, enhanced %{, %}, %_. 504- rand48() function in zsh/mathfunc for better randomness in arithmetic 505 (if the corresponding math library function is present) 506- $SECONDS parameter can be made floating point via `typeset -F SECONDS' 507 for better timing accuracy 508- improvements to command line history mechanism 509- job table is dynamically sized, preventing overflow (typically seen 510 previously in complex completions). 511- many bugfixes 512 513 514New features in zsh version 4.0.1 515--------------------------------- 516 517Compared with 3.1.9, there are mostly incremental improvements to 518 - the new completion system --- more functions, completers, styles... 519 - the line editor 520 - handling of signals and traps 521 - the configuration system, particularly for modules 522 - Cygwin support (now essentially complete) 523 - arithmetic evaluation 524 - the zpty (pseudoterminal handling) module 525 - the test suite 526plus various bug fixes and compatibility improvements. 527 528The alias modules (zle.so as an alias for zsh/zle.so, etc.) have been 529removed; use `zmodload -A' to load modules under other names. This is 530irrelevant if you are upgrading from 3.0. 531 532Compared with the 3.0 series of releases (the last stable set), the most 533significant of a large number of improvements in the shell are: 534 - Dynamically loadable modules with hierarchical naming system 535 - Shell functions as editor functions, with much additional builtin support 536 - Incredibly rich new completion system; just needs a single 537 initialization command to provide completion for all sorts of commands 538 and contexts 539 - Associative arrays 540 - Lots of new features in parameter substitution and globbing; more 541 logical handling of nested parameter substitutions 542 - Rewritten pattern-matching (globbing) code supports approximate 543 and case-insensitive matching and backreferences 544 - Various custom modules for pty's, FTP, special parameters, etc. 545 - Rewrites of many internal parts of the code: execution code to 546 provide compilation to internal representation, pattern matching 547 - Floating point arithmetic and mathematical functions module 548 - A test suite 549 - Various new options for compatibility with this, that and the other 550See the 3.1.x changes below for more detail. 551 552 553New features in zsh version 3.1.8 and 3.1.9 554------------------------------------------- 555These are primarily bug-fix versions. There are only a few user-visible 556changes. 557 - Array slices ${array[a,b]} with b < a now correctly have zero length. 558 559 560New features in zsh version 3.1.7 561--------------------------------- 562Further enhancements to new completion system: 563 - Comprehensive context-sensitive configuration via `styles', which 564 can be set by the menu-driven front end in compinstall 565 - General mechanism for setting patterns to be ignored in a completion; 566 overriding of patterns to be matched for functions 567 - New completers: _prefix to complete word before cursor, _ignored 568 to complete using words so far ignored (like $fignore but more 569 powerful), _history to complete words from shell history 570 - Multiple use of completers with different options, similarly splitting 571 of different types of completion (`tags') so they are considered with 572 different styles 573 - Many more supplied completions for standard commands which work out of 574 the box, and better handling of command line options/arguments which 575 behave in the usual way 576 - $fpath now set up to use installed functions by default; functions 577 can be loaded just by `autoload -U compinit; compinit' 578 - Much improved handling of nested quoting and nested braces 579 - New LIST_PACKED and LIST_ROWS_FIRST completion options and corresponding 580 styles 581 - compctl library separated out (frozen but still supported) 582 - User-friendly introduction available at zsh website 583 http://zsh.sourceforge.net/ 584 585Additions to complist listing library (coloured completion and menu 586selection): 587 - Listings can be shown page by page (are by default for new completion) 588 - Menu selection allows full up and down scrolling of long lists 589 590Other editing features: 591 - new parameters $PENDING, $MARK, $BUFFERLINES 592 - Easy display of a prompt from within an editing widget 593 594Code parsing, storing and execution: 595 - Completely new system of storing code internally, greatly optimised 596 - Much less memory for shell functions etc. 597 - Can compile shell functions to .zwc `wordcode' functions for fast 598 loading 599 - Can create `digest' files of entire directories in .zwc format 600 601Parameters: 602 - Floating point support added, similar to ksh93, `typeset -F' and 603 `typeset -E' declare floating point variables; usual C/Fortran-like 604 rules for integer/float conversion 605 - Mathematical library zsh/mathfunc contains all the standard mathematical 606 functions for use in arithmetical expressions 607 - Improved parsing of arithmetical expressions and better error messages 608 - Special parameters can be made local 609 - `typeset -h' hides specialness of parameters, either as parameter 610 attribute or when declaring new local variable 611 - Local parameters can now be exported as in other shells; new option 612 GLOBAL_EXPORTS on by default provides old behaviour that `typeset -x' 613 referred to global parameters. 614 - zsh/parameter module enhanced: now needed for new completion; parameters 615 provided have `-h' flag set so that they are hidden by `typeset', so 616 that existing functions don't need to be changed 617 - Quotes can be stripped from parameter values with ${(Q)...}, providing 618 reverse of ${(q...)...} facility 619 620Globbing and pattern matching: 621 - Pattern matching rewritten for efficiency 622 - Supports `backreferences', i.e. extracting parenthesised chunks of 623 matches, e.g. 624 [[ $foo = (#b)(*/)[^/]* ]] 625 stores the part of $foo up to the last / in $match[1] and the indexes of 626 the match in $mbegin[1], $mend[1]. (#m) is also available to set $MATCH 627 to the entire match and corresponding $MBEGIN, $MEND: useful in 628 parameter substitutions like ${.../.../...}. 629 - (#s) and (#e) match start and end of pattern like ^ and $ in regular 630 expression, useful in complex expressions such as ((#s)|/)dirname((#e)|/) 631 and in parameter expressions. 632 633 - Depth-first/last listing of recursive glob lists 634 635Functions etc.: 636 - `autoload -X' inside a function body instructs the shell to 637 bootstrap the function at that point 638 - `autoload +X fn' says load the function fn but don't execute it 639 - Prompt `themes' make customization of prompts easier 640 641Modules: 642 - New hierarchical naming scheme for modules; supplied modules go into 643 zsh subdirectory, so zle becomes zsh/zle etc.; aliases supplied for 644 compatibility for existing code, but the new format should be used in 645 future. 646 - zmodload is more consistent between dynamically and statically linked 647 shells 648 - zsh/zftp and its function suite support multiple sessions (zfsession 649 command); zftransfer allows transfer of files between two ftp sessions 650 with no local file; use styles for e.g. progress style; IPv6 supported; 651 recursive put `zfput -r' for uploads 652 - zsh/zpty module creates pseudoterminal and allows builtin `expect'-like 653 behaviour 654 655Other: 656 - Test suite, not yet complete (`make test') 657 - use of Linux task limits 658 - Many fixes including output redirection with `setopt xtrace' and 659 other redirection fixes; NIS+ problem. 660 - Better null-command behaviour in sh and csh emulation 661 - Internal memory usage optimisations 662 663 664New features in zsh version 3.1.6 (beta version) 665------------------------------------------------ 666Note also the changes for 3.0.6, which include changes between 3.1.5. and 6673.1.6. 668 669New completion system via shell functions; massive degree of 670programmability and configurability: 671 - ready-made function suite to use, see zshcompsys(1) 672 - approximate completion and spelling correction via completion 673 - control over matching for case-independence, partial word completion, etc. 674 - menu selection: choose a completion by moving the cursor 675 - coloured completion lists 676 - completion of filenames in quotes is now more reliable; splitting 677 quoted strings into command arguments is also possible. 678 679Other editing changes: 680 - enhancements to function/editing interface: new parameters, numeric 681 arguments, string argument passing, reading keys from widgets. 682 - the old history-search-{back,for}ward behaviour and bindings have 683 returned (up to minor details). 684 - BASH_AUTO_LIST option to show completion list only on second key press. 685 - the ZBEEP parameter gives a string to output instead of beeping, 686 allowing you to have a visual bell. 687 688History changes: new options HIST_NO_FUNCTIONS, HIST_EXPIRE_DUPS_FIRST, 689HIST_FIND_NO_DUPS, HIST_IGNORE_ALL_DUPS, INC_APPEND_HISTORY, 690HIST_SAVE_NO_DUPS, SHARE_HISTORY, allow better control of when history is 691read and written and how duplicates are handled. New format for history 692saves. 693 694Associative arrays plus enhanced parameter substitutions to retrieve keys 695and values. 696 697Globbing changes: 698 - Case-insensitive and approximate globbing. 699 - Ordering and indexing of globbing matches, e.g. *(om[1]) picks 700 most recently modified file. 701 - General file mode qualifier with chmod(1)-like syntax, e.g. *(f:u+wx:) 702 703New loadable modules: 704 - zftp, plus associated function suite, for turning your zsh session 705 into an FTP session too 706 - parameter, for examining and altering shell hash tables via an 707 associative array interface. 708 - mapfile, for reading and writing external files via an associative 709 array interface. 710 711Debugging and prompt enhancements: 712 - $PS4 can contain %i for $LINENO as well as %N for script or function 713 names (default PS4 changed), also %_ for current shell structure 714 executing; 715 - Prompt truncation %<...< is now more flexible: it applies to a 716 whole section of the prompt, not just one escape. You need to put 717 %<< after the truncated escape to get the old behaviour. 718 - %20(l.yes.no) in prompts prints yes if at least 20 characters have 719 been output, else no (e.g. for outputting extra newlines). 720 721Parameter and expansion changes 722 - `typeset -t MYPATH mypath' creates tied path/PATH-like variables 723 - `typeset -g' allows operations on parameters without making them local 724 - New expansions 725 - ${(t)param} prints type information for $param 726 - ${(P)param} treats value of $param as the name of a param to 727 substitute 728 - ${foo:q} can quote replaced parameter text from expansion 729 - ${foo/old/new} substitution, like bash; also (S) flag for shortest 730 match 731 - $foo[(b.2.i)bar] starts searching $foo for bar starting at 2nd match 732 733Builtin and function changes 734 - stat module: `stat -H hash foo' gives you e.g. $hash[mtime] 735 - `autoload -U' autoloads functions without alias expansion. 736 737Other new options: 738 - LOCAL_TRAPS allows signal traps to be local to functions (as in ksh). 739 - NO_RCS can now be turned on at any point in initialization files. 740 - NO_GLOBAL_RCS can force /etc/z* files after /etc/zshenv to be skipped. 741 (Please don't use this as an excuse to stuff more into /etc/zshenv!) 742 - Existing MAGIC_EQUAL_SUBST option is more useful; any argument containing 743 ...=~...:~... will perform filename expansion on the ~ (previously, 744 the string before `=' had to look like a parameter name). 745 746Configuration changes: 747 - Generation of signal names should be more reliable 748 - Customizable installation of shell functions from distribution. 749 750 751New features in zsh version 3.0.6 752--------------------------------- 753 754Most of these changes are designed to improve compatibility with zsh 755version 3.1.6, the latest development release. However, this release also 756fixes all known Year 2000 (Y2K) bugs in zsh 3.0. 757 758History changes: 759 - whitespace between words is ignored in history searches. 760 - new option HIST_REDUCE_BLANKS removes extra whitespace in the stored 761 history. 762 - support for reading (but not writing) version 3.1.6 history files. 763 764Globbing changes: 765 - the a, c, and m glob qualifiers can now test time in seconds. 766 - globbing of number ranges behaves more like character ranges in that 767 it can match a prefix of a number, e.g. `<1-5>*' matches 1, 2, 3, 4, 768 5, 17, 23skiddoo, 5986, etc., but not 6, 7, 8ball, 911, etc. 769 770Parameter and expansion changes: 771 - expansion of ~ and other globbing flags via ${~param} do not depend 772 upon EXTENDED_GLOB (bug fix). 773 - nested parameter substitutions require braces (this was always the 774 documented behavior, but previous parsers didn't enforce it). 775 - quote only nested expansion, e.g. ${(f)"$(<file)"} reads complete 776 `file', then splits lines into array. 777 778Builtin and function changes: 779 - `typeset -U' works on the colon-array version of linked parameters. 780 - `typeset +f' and `functions +' output the names (only) of functions. 781 - `emulate -L' has the effect of `setopt localoptions'. 782 - in fn1() { local foo; unset foo; foo=bar; }, foo is restored at local 783 level, whereas if the `unset foo' appeared in a nested function it 784 would have been restored at global level, which was presumably wrong. 785 - `foo=bar >&file' is a redirection, not a NULLCMD. 786 - any single complex command, such as `case ... esac', parses as if 787 semicolon-terminated (bug fix). 788 - the shell function `preexec', if defined, is run after parsing each 789 command line but before executing the command. 790 791Other changes: 792 - the option PRINT_EIGHT_BIT causes zsh to emit raw bytes in prompts 793 and completion lists even if the system ctype(3) package says that 794 those bytes are not "printable." 795 796Debugging enhancements: 797 - LINENO is now very much more useful in scripts and functions and is 798 reported correctly in most error messages. 799 - ERREXIT behavior is now consistent with newer Bourne-like shells, 800 e.g. with respect to `if' tests that fail. 801 802Configuration changes: 803 - Large file and 64-bit integers on 32-bit machines supported where 804 provided by OS. 805 - a few more system features, such as getpwnam/getpwuid, are tested for. 806 807 808New features in zsh version 3.1 (beta version) 809---------------------------------------------- 810 811On most operating systems zsh can load binary modules dynamically at 812run-time. ZLE and the compctl builtin are now reside in a separate 813module which is loaded automatically on demand. 814 815for ((expr; expr; expr)) do ... done loop syntax from AT&T ksh93 is 816now supported. 817 818POSIX globbing character classes ([:alnum:] etc.) are now supported. 819 820ksh's case fall-through feature (;&) is supported. 821 822ksh93's $'' quoting syntax is supported. 823 824Restricted mode is now supported. This is controlled by the new option 825RESTRICTED (-r). 826 827New options BARE_GLOB_QUAL, HIST_NO_FUNCTIONS (alias NO_LOG), KSH_GLOB, 828PRINT_EIGHT_BIT, PROMPT_BANG, PROMPT_PERCENT, RM_STAR_WAIT. 829 830Options ALWAYS_LAST_PROMPT, APPEND_HISTORY, AUTO_LIST, AUTO_MENU, 831AUTO_PARAM_KEYS, AUTO_PARAM_SLASH, AUTO_REMOVE_SLASH, LIST_AMBIGUOUS 832and LIST_TYPES are now on by default. 833 834In ZLE, arbitrarily many keymaps can be defined. Multi-character 835keybindings now work. 836 837Completion can be performed within a brace expansion. 838 839EMACS-like universal-argument function. 840 841 842New features in zsh version 3.0 843------------------------------- 844 845Trailing "/" in a glob pattern now works like in other shell thus it 846can no longer be used as a shorthand for "(/)". 847 848Much improved sh/ksh emulation. When zsh is invoked as sh it mostly 849conforms to POSIX 1003.2. 850 851Enhanced parameter expansion features: new flags: A, @, e, W, p, f, F. 852Expansions can be nested. For example, 853"${${(M)${(f@)$(<builtin.pro)}:#char*}[2][(w)3]}" expands to the third 854word of the second line of builtin.pro which begins with char. See 855zshexpn(1) for the details. 856 857***/foo glob does recursive directory search following symbolic links. 858 859Traps defined by the trap builtin are now executed in the current shell 860environment and not as a shell function. This means that $1 is not set 861to the signal number. Of course the TRAPxxx functions continue working 862as before. 863 864Traps defined by the trap builtin are reset to their default values in 865subshells. 866 867Option names can be prefixed by `no' to unset an option. 868setopt no_option_name is the same as unsetopt option_name. 869This change affects the output of the setopt and unsetopt 870builtins when these are invoked without arguments. See 871the zshoptions manual page for more explanation. 872 873!, {, } and [[ are now reserved words. Things like [[-z $foo]] or {foo} 874should not be used. {foo} still works if the IGNORE_BRACES option is not 875set but this feature may be removed in the future. [[ -z $foo ]] and 876{ foo } should be used instead. 877 878HOSTTYPE special parameter is removed. The new OSTYPE, MACHTYPE and 879VENDOR parameters should be used instead. 880 881VERSION parameter is renamed to ZSH_VERSION 882 883exec now saves the history in interactive shells. If you do not like this 884behaviour you can alias exec to 'unset HISTFILE ; exec'. 885 886${~spec}, ${=spec} and ${^spec} used to toggle the effect of 887globsubst/shwordsplit/rcexpandparam. Now these force the corresponding 888option on. ~, = or ^ can be doubled to force the relevant option off for 889the substitution. 890 891Explicitly requested word splitting like ${=spec} or ${(s:delim:)spec} 892will be executed even if the substitution is double quoted. 893 894The right-hand side of assignments are no longer globbed by default hence 895assignment foo=* will assign '*' as a value of foo. Use the foo=( * ) 896array assignment syntax to get the old behaviour. Alternatively the 897GLOB_ASSIGN can be set to emulate the old behaviour but the usage of this 898option is strongly discouraged and this option may be completely removed in 899the future. 900 901foo=$bar no longer creates an array even if bar is an array. Use 902foo=( $bar ) or even better, foo=( "$bar[@]" ) instead. 903 904When foo is an array parameter ${#foo} will always return the length of the 905array even if the substitution is double quoted. ${(c)#foo} should be used 906to get back the old behaviour. 907 908When the prompt_subst option is set prompts are fully expanded using 909parameter expansion, command substitution and arithmetic expansion. 910In 2.5 backquote substitution was not performed in the prompts so this 911change might cause problems in some startup scripts if ` is used literally 912in prompts. 913 914History substitution is now not performed if the history escape character 915appears in a single-quoted string. This may break some interactive shell 916functions which use \! in single-quoted strings. 917 918The UID, EUID, GID, EGID parameters can be assigned now. The assignment 919executes the setuid(), seteuid(), setgid(), setegid() respectively. On 920systems where setuid and seteuid is not supported these functions are 921emulated using setreuid or setresuid which may result in a different 922behaviour. 923 924Assigning the USERNAME parameter will call setuid(uid) where uid is the 925user id of the specified user. 926 927The privileged (-p) option is automatically set on invocation if euid != uid 928or egid != gid. If this option is set no user startup files are sourced. 929The shell will drop privileges when this option is unset by resetting its 930euid to uid and its egid to gid. 931 932The =number substitution for accessing the directory stack is changed to 933~number to allow =command substitution when a command name begins with a 934digit. 935 936<> is a redirection operator which opens the standard input for both 937reading and writing. To match a number use <->. 938 939Option letters -1 and -C for PRINT_EXIT_VALUE and NO_CLOBBER are swapped: 940`set -C' sets NO_CLOBBER and `set -1' sets PRINT_EXIT_VALUE. 941 942AUTO_PUSHD behaviour is changed. Now cd without arguments will always go 943to the $HOME directory even if AUTO_PUSHD is set and PUSHD_TO_HOME is not 944set. If you preferred the old behaviour you can alias cd to pushd. 945 946IFS word splitting with SH_WORD_SPLIT and the splitting of the input in the 947read builtin has changed in cases when IFS contains characters other than 948<space>, <tab>, <newline>. See the description of IFS in the zshparam 949manual page for more details. 950 951 952New features in zsh version 2.5 953------------------------------- 954 955Greatly expanded completion possibilities. Programmable completion 956allows detailed control over what arguments of what commands can be 957completed to what. See dots/zcomp in the distribution for examples. 958 959Expand filenames with ~ and = on the right hand side of parameter 960assignments. New option MAGIC_EQUAL_SUBST to do it in all 961identifier=expression arguments. 962 963${+name} becomes 1 or 0 if name is set or unset. ${~spec} toggles 964GLOB_SUBST in substitution. Parameter substitution takes lots 965of flags in the format ${(flags)name}. 966 967New glob qualifiers for block/character special files, times in glob 968qualifiers can be in months, weeks, days, hours, minutes. Qualifiers can 969work on links or on what they point to. Qualifiers separated by commas 970are or-ed. 971 972New parameter substitution modifiers (fFwW) to repeat actions. New 973option CSH_JUNKIE_HISTORY. 974 975New line editor functions history-beginning-search-backward, 976history-beginning-search-forward, expand-or-complete-prefix, push-input, 977push-line-or-edit. 978 979Assign to part of a string, use qualifiers on string subscription with 980$foo[(qual)2,5] 981 982New parameters: EGID, EUID, KEYTIMEOUT 983 984New prompt escape sequence %_ to get constructs like for and while in 985the secondary prompt. %E in prompt clears to end of screen. 986 987Conditional expressions in PROMPT and WATCHFMT. 988 989New options ALWAYS_LAST_PROMPT, ALWAYS_TO_END, AUTO_PARAM_KEYS, 990COMPLETE_ALIASES, COMPLETE_IN_WORD, CSH_JUNKIE_HISTORY, GLOB_SUBST, 991LIST_AMBIGUOUS, MAGIC_EQUAL_SUBST, NO_FLOW_CONTROL, PROMPT_SUBST 992 993New option -m to many builtins makes arguments subject to pattern 994matching. 995 996Bindkey can now bind both key sequences and prefixes of those. You can 997for example bind ESC and function keys sending ESC sequences. 998 999Additional options to read builtin to use in functions called by 1000completion. 1001 1002New options to print to sort arguments and print them in columns. 1003 1004Some additional resource limits can be specified. 1005 1006Some editor functions now work in the minibuffer. 1007