1------------------------------------- 2CHANGES FROM PREVIOUS VERSIONS OF ZSH 3------------------------------------- 4 5Note also the list of incompatibilities in the README file. 6 7Changes since 5.8 8----------------- 9 10CVE-2021-45444: Some prompt expansion sequences, such as %F, support 11'arguments' which are themselves expanded in case they contain colour 12values, etc. This additional expansion would trigger PROMPT_SUBST 13evaluation, if enabled. This could be abused to execute code the user 14didn't expect. e.g., given a certain prompt configuration, an attacker 15could trick a user into executing arbitrary code by having them check 16out a Git branch with a specially crafted name. 17 18This is fixed in the shell itself by no longer performing PROMPT_SUBST 19evaluation on these prompt-expansion arguments. 20 21Users who are concerned about an exploit but unable to update their 22binaries may apply the partial work-around described in the file 23Etc/CVE-2021-45444-VCS_Info-workaround.patch included with the shell 24source. [ Reported by RyotaK <security@ryotak.me>. Additional thanks to 25Marc Cornellà <hello@mcornella.com>. ] 26 27Changes since 5.7.1-test-3 28-------------------------- 29 30CVE-2019-20044: When unsetting the PRIVILEGED option, the shell sets its 31effective user and group IDs to match their respective real IDs. On some 32platforms (including Linux and macOS, but not FreeBSD), when the RUID and 33EUID were both non-zero, it was possible to regain the shell's former 34privileges by e.g. assigning to the EUID or EGID parameter. In the course 35of investigating this issue, it was also found that the setopt built-in 36did not correctly report errors when unsetting the option, which 37prevented users from handling them as the documentation recommended. 38setopt now returns non-zero if it is unable to safely drop privileges. 39[ Reported by Sam Foxman <samfoxman320@gmail.com>. ] 40 41Changes from 5.7.1 to 5.7.1-test-3 42---------------------------------- 43 44The zsh/zutil module's zparseopts builtin learnt an -F option to abort 45parsing when an unrecognised option-like parameter is encountered. 46 47The zsh/files module gained a chmod builtin. 48 49Several changes have been made to the way completion functions track 50'precommands' (such as `command` and `env`) and determine whether the 51command being completed for is a shell builtin. Developers of completion 52functions may wish to familiarise themselves with `_normal -p` and 53`_pick_variant -b`. 54 55The option CD_SILENT was added to suppress all output from cd (whether 56explicit or implicit with AUTO_CD). It is disabled by default. 57 58The compadd builtin's -o option now takes an optional argument to 59specify the order of completion matches. This affects the display 60of candidate matches and the order in which they are selected when 61cycling between them using menu completion. 62 63The :h and :t modifiers in parameter expansion (if braces are present), 64glob qualifiers and history expansion may take following decimal digit 65arguments in order to keep that many leading or trailing path components 66instead of the defaults of all but one (:h) and one (:t). In an absolute 67path the leading '/' counts as one component. 68 69The functions builtin gained a -c option to efficiently copy functions. 70 71The zshmisc(1) manual page incorrectly stated that when 'exit' is used 72in a `try' block inside a function, the corresponding `always' block will 73be executed. The manual page has been corrected. The shell's behaviour 74has not changed, but code such as the following: 75. 76 f() { { exit } always { echo Hello world } } 77. 78should be changed either to use 'return' instead of 'exit', or to have 79the try/always block outside of any function. 80 81Changes from 5.6.2 to 5.7.1 82--------------------------- 83 84There are only minor changes between 5.7 and 5.7.1. 85 86Support for 24-bit true color terminals has been added. Hex triplets 87can be used when specifying colours for prompts and line editor 88highlighting. On 88 and 256 colour terminals, a new zsh/nearcolor module 89allows colours specified with hex triplets to be matched against the 90nearest available colour. 91 92The zsh/datetime module's strftime builtin now accepts an argument 93specifying the nanoseconds time component; both arguments can be omitted 94to use the current time. 95 96Changes from 5.6.1 to 5.6.2 97--------------------------- 98 99Fix another SIGTTOU case. 100 101Fix SIGWINCH being ignored when zsh is not in the foreground. 102 103The release tarballs are now compressed using xz(1), whereas previously 104both xz(1) and gzip(1) versions were available. If this gets in your way, 105give us a shout. 106 107Changes from 5.6 to 5.6.1 108------------------------- 109 110Fix packaging issue that broke runhelp. 111 112Fix a regression with pipelines getting backgrounded and emitting SIGTTOU. 113 114Changes from 5.5.1-test-2 to 5.6 115-------------------------------- 116 117CVE-2018-0502: Data from the second line of a #! script file might be passed to 118execve(). For example, in the following situation - 119. 120 printf '#!foo\nbar' > baz 121 ./baz 122. 123the shell might take "bar" rather than "foo" for the argv[0] to be passed to 124execve(). [ Reported by Anthony Sottile and Buck Evan. ] 125 126CVE-2018-13259: A shebang line longer than 64 characters would be truncated. 127For example, in the following situation: 128. 129 ( printf '#!'; repeat 64 printf 'x'; printf 'y' ) > foo 130 ./foo 131. 132the shell might execute x...x (64 repetitions) rather than x...xy (64 x's, 133one y). [ Reported by Daniel Shahaf. ] 134 135Changes from 5.5.1 to 5.5.1-test-2 136---------------------------------- 137 138Non-stop IEEE 754 arithmetic support - Inf and NaN are now returned 139from floating point operations where errors were printed before. 140Inf and NaN are also recognised in arithmetic expressions. 141 142In shell patterns, [[:blank:]] now honours the locale instead of 143matching exclusively on space and tab, like for the other POSIX 144character classes or for extended regular expressions. 145 146The zsh/system module now provides the PID of the last process 147substitution via $sysparams[procsubstpid]. 148 149Time formatting via the %D prompt escape now offers nanosecond 150precision with the %. and %N format specifiers. Additionally, 151nanosecond precision on file times is supported in the module 152zsh/stat. 153 154The zsh/mathfunc module now includes a log2() function. 155 156The parameter ZLE_RECURSIVE has been added to indicate the 157current ZLE recursion level. 158 159Changes from 5.5 to 5.5.1 160------------------------- 161 162Apart from a fix for a configuration problem finding signal names from 163(some) recent versions of glibc, there are only minor changes. 164 165Changes from 5.4.2 to 5.5 166------------------------- 167 168The effect of the NO_INTERACTIVE_COMMENTS option extends into $(...) and 169`...` command substitutions when used on the command line. Previously, 170comments were always recognized within command substitutions unless the 171comment character "#" was disabled via reset of $histchars. 172 173An alternative assignment syntax for indicating indices for arrays 174and keys for associative arrays: 175 176typeset -a array=([1]=first [2]=second) 177typeset -A assoc=([key1]=val1 [key2]=val2) 178 179is allowed for compatibility with other shells. In the case of normal 180arrays the new syntax can be mixed with the old. 181 182The %E, %S, and %U TIMEFMT specifiers now support m and u prefixes 183(e.g., %mE) to output times in milliseconds and microseconds, 184respectively. 185 186The option CHECK_RUNNING_JOBS was added to control whether zsh should 187check for running jobs in addition to suspended ones with CHECK_JOBS. 188It is enabled by default. 189 190Changes from 5.3.1 to 5.4.2 191--------------------------- 192 193There are only minor changes between 5.4 and 5.4.2. 194 195The 'exec' and 'command' precommand modifiers, and options to them, are 196now parsed after parameter expansion. Previously, both the modifier and 197any options to it were parsed between alias expansion and parameter 198expansion (see zshexpn(1)), so they could neither be quoted nor be the 199result of parameter expansion. Examples: 's=command; $s -V ls' and 200'\command -V ls' now work as expected. 201 202Functions executed by ZLE widgets no longer have their standard input 203closed, but redirected from /dev/null instead. That still guards 204against user defined widgets inadvertently reading from the tty device. 205 206There is an option WARN_NESTED_VAR, a companion to the existing 207WARN_CREATE_GLOBAL that causes a warning if a function updates a 208variable from an enclosing scope without using typeset -g. It can be 209turned on for an individual function with "functions -W". 210 211zmodload now has an option -s to be silent on a failure to find a module 212but still print other errors. 213 214The autoload builtin gained several new features to load functions from a 215file path determined at the time of definition rather than at the time of 216loading. 217 218The zsh/parameter module now exposes the file paths associated with 219shell functions via the parameters functions_source and 220dis_functions_source. 221 222Changes from 5.2 to 5.3.1 223------------------------- 224 225There are only minor compatibility fixes between 5.3 and 5.3.1. 226 227It is possible to enable character width support for Unicode 9 by 228configuring with `--enable-unicode9'; this compiles in some additional 229tables. At some point this support may move into a module, in which 230case the configure option will be changed to cause the module to be 231permanently loaded. This option is not useful unless your terminal also 232supports Unicode 9. 233 234The new word modifier ':P' computes the physical path of the argument. 235It is different from the existing ':a' modifier which always resolves 236'/before/here/../after' to '/before/after', and differs from the 237existing ':A' modifier which resolves symlinks only after 'here/..' is 238removed, even when /before/here is itself a symbolic link. It is 239recommended to review uses of ':A' and, if appropriate, convert them 240to ':P' as soon as compatibility with 5.2 is no longer a requirement. 241 242The output of "typeset -p" uses "export" commands or the "-g" option 243for parameters that are not local to the current scope. Previously, 244all output was in the form of "typeset" commands, never using "-g". 245 246vi-repeat-change can repeat user-defined widgets if the widget calls 247zle -f vichange. 248 249The parameter $registers now makes the contents of vi register buffers 250available to user-defined widgets. 251 252New vi-up-case and vi-down-case builtin widgets bound to gU/gu (or U/u 253in visual mode) for doing case conversion. 254 255A new select-word-match function provides vim-style text objects with 256configurable word boundaries using the existing match-words-by-style 257mechanism. 258 259Support for the conditional expression [[ -v var ]] to test if a 260variable is set for compatibility with other shells. 261 262The print and printf builtins have a new option -v to assign the output 263to a variable. This is for bash compatibility but with the additional 264feature that, for an array, a separate element is used each time the 265format is reused. 266 267New x: syntax in completion match specifications make it possible to 268disable match specifications hardcoded in completion functions. 269 270Changes from 5.1.1 to 5.2 271------------------------- 272 273The new module zsh/param/private can be loaded to allow the shell 274to define parameters that are private to a function scope (i.e. are 275not propagated to nested functions called within this function). 276 277The parameter flag ${(P)...} is now more useful when it appears in 278a nested expansion. For example, 279 280 typeset -A assoc=(one un two deux three trois) 281 name=assoc 282 print ${${(P)name}[one]} 283 284now prints "un". In previous versions of the shell the value of the 285substitution was fully expanded on return from ${(P)name}, making 286associative array subscripting difficult. As a side effect, flags 287for formatting appearing in the inner substitution now affect the 288substitution of the name (into "assoc" in this case), which is not 289normally useful: flags that should apply to the value must be in the 290outer substitution. 291 292The GLOB_STAR_SHORT option allows the pattern **/* to be shortened to 293just ** if no / follows. so **.c searches recursively for a file whose 294name has the suffix ".c". 295 296The effect of the WARN_CREATE_GLOBAL option has been significantly 297extended, so expect it to cause additional warning messages about 298parameters created globally within function scope. 299 300Paste highlighting (added in 5.1) is now enabled by default to signal 301that accept-line hasn't occurred. Paste highlighting may be disabled 302via 303 zle_highlight+=(paste:none) 304. Disabling paste highlighting will retain the "bracketed paste" 305behaviour, unless that is separately disabled via zle_bracketed_paste. 306 307Changes from 5.1 to 5.1.1 308------------------------- 309 3105.1.1 is primarily a bug fix release; however, a few minor features were 311added. 312 313The ZLE variables YANK_ACTIVE, YANK_START and YANK_END have been added 314and are useful for managing highlighting. 315 316The zsh-specific pattern match range tests have been supplemented with 317[:INCOMPLETE:] and [:INVALID:] to help detect the state of partially 318read multibyte character strings. 319 320Changes from 5.0.8 to 5.1 321------------------------- 322 323The builtins declare, export, local, readonly and typeset 324now have corresponding reserved words. When used in 325this form, the builtin syntax is extended so that assignments 326following the reserved word are treated similarly to 327assignments that appear at the start of the command line. 328For example, 329 local scalar=`echo one word` array=(several words) 330creates a local "scalar" containing the text "one word" 331and an array "array" containing the words "several" 332"words". 333 334- The print builtin has new options -x and -X to expand tabs. 335 336- Several new command completions and numerous updates to others. 337 338- Options to "fc" to segregate internal and shared history. 339 340- All emulations including "sh" use multibyte by default; several 341 repairs to multibyte handling. 342 343- ZLE supports "bracketed paste" mode to avoid interpreting pasted 344 newlines as accept-line. Pastes can be highlighted for visibility 345 and to make it more obvious whether accept-line has occurred. 346 347- Improved (though still not perfect) POSIX compatibility for getopts 348 builtin when POSIX_BUILTINS is set. 349 350- New setopt APPEND_CREATE for POSIX-compatible NO_CLOBBER behaviour. 351 352- Completion of date values now displays in a calendar format when 353 the complist module is available. Controllable by zstyle. 354 355- New parameter UNDO_LIMIT_NO for more control over ZLE undo repeat. 356 357- Several repairs/improvements to the contributed narrow-to-region 358 ZLE function. 359 360- Many changes to child-process and signal handling to eliminate race 361 conditions and avoid deadlocks on descriptor and memory management. 362 363- New builtin sysopen in zsh/system module for detailed control of 364 file descriptor modes. 365 366 367Changes from 5.0.0 to 5.0.8 368--------------------------- 369 370- Global aliases can be created for syntactic tokens such as command 371 separators (";", "&", "|", "&&", "||"), redirection operators, etc. 372 Use at your own risk! The POSIX_ALIASES option is interpreted more 373 strictly to prevent expansion of these and other alias names containing 374 quotes, glob metacharacters, parameter references, etc. 375 376- There have been various further improvements to builtin handling 377 with the POSIX_BUILTINS option (off by default) for compatibility with 378 the POSIX standard. 379 380- 'whence -v' is now more informative, and 'whence -S' shows you 381 how a full chain of symbolic links resolves to a command. 382 383- The 'p' parameter flag now allows an argument to be specified 384 as a reference to a variable, e.g. ${(ps.$sep.)foo} to split $foo 385 on a string given by $sep. 386 387- The option FORCE_FLOAT now forces variables, not just constants, 388 to floating point in arithmetic expressions. 389 390- The type of an assignment in arithmetic expressions, e.g. the 391 type seen by the variable res in $(( res = a = b )), is now 392 more logical and C-like. 393 394- The default binding of 'u' in vi command mode has changed to undo 395 multiple changes when invoked repeatedly. '^R' is now bound to redo 396 changes. To revert to toggling of the last edit use: 397 bindkey -a u vi-undo-change 398 399- Compatibility with Vim has been improved for vi editing mode. Most 400 notably, Vim style text objects are supported and the region can be 401 manipulated with vi commands in the same manner as Vim's visual mode. 402 403- Elements of the watch variable may now be patterns. 404 405- The logic for retrying history locking has been improved. 406 407- Some rationalisations have been made to the zsh/db/gdbm module that 408 should make it more useful and predictable in operation. 409 410- Numeric constants encountered in mathematical expressions (but not other 411 contexts) can contain underscores as separators that will be ignored on 412 evaluation, as allowed in other scripting languages. For example, 413 0xFFFF_FFFF, or 3.141_592_654. From 5.0.6 this is also available 414 in output, e.g. 415 setopt cbases 416 zmodload zsh/mathfunc 417 print $(( [#16_4] 2**32 - 1 )) $(( [#_3] 4 * atan(1.0) )) 418 419- "functions -T" turns on tracing for the specified function(s) only, 420 similar to "functions -t" except that tracing is turned off for any 421 functions called from the specified one(s) that don't also have the -t 422 or -T flag. 423 424- The option FORCE_FLOAT has been added to force all arithmetic constants 425 to be treated as floating point. This is most useful locally within 426 functions or scripts performing floating point calculations. 427 428- The default $fpath/$FPATH is now designed to include 429 /usr/local/share/zsh/site-functions unless the installer has 430 specifically decided to use another path, i.e. regardless of 431 the standard installation location. This directory does not need to 432 exist. Sites that set an explicit site directory can put that in 433 /etc/zshenv as before. The intention of the new path element is to 434 increase the likelihood that locally added functions can be found with 435 the shell running "out of the box", unless the shell has been 436 deliberately configured differently by the installer for some special 437 purpose. 438 439- Individual pattern characters can be disabled. For example, to allow '^' 440 to be an ordinary character even if the option EXTENDED_GLOB is set, use 441 "disable -p '^'". 442 443- The variable editing builtin vared can be given custom editing widgets 444 for initialisation and finishing. 445 446- The line editor's capability for listening on file descriptors 447 additional to the terminal has been enhanced so that the handler for 448 such file descriptors can be a line editor widget. Previously the 449 handler always behaved as a standard shell function. 450 451- Hooks for adding history (the function zshaddhistory and the 452 array zshaddhistory_functions) can return status 2 to indicate that 453 history is to be saved internally within the shell but not written. 454 455- In file completion, the recursive-files style can be set to an array of 456 patterns to match against "$PWD/". In any matched location, it is 457 possible to complete files in arbitrarily deep subdirectories without 458 needing to type the directory prefix. See example in the zshcompsys 459 manual. 460 461- The _user_expand completer now allows expansion functions in the 462 user-expand files to return a string in REPLY that will be used to name 463 the set of expansions returned. 464 465- The parameter HISTORY_IGNORE may be set to a pattern which matches 466 lines in the internal history that are to be omitted from the history 467 file at file write time. This differs from history changes made in 468 the zshaddhistory hook or by the HIST_IGNORE_* options, all of which 469 take effect immediately on the internal history list itself. 470 471- The parameter ZLE_RPROMPT_INDENT can be set to 0 to remove the space 472 before the right hand side of the screen (this causes problems with 473 some terminals). It is not special and is not set by default; the 474 effect in that case is as if it was 1, as in previous versions. 475 476- If the option EXTENDED_GLOB is in effect, it is possible to force 477 globbing within conditional code using the [[ ... ]] syntax by flagging 478 that a certain string is a glob using the (#q) glob qualifier syntax. 479 The resulting glob is treated as a single argument. For example, 480 [[ -n *.c(#qN) ]] tests whether there are any .c files in the current 481 directory. 482 483- In prompt strings, the %N(l.true.false) conditional (line length) and 484 the %N<..< and %N>..> truncation operators now accept negative values 485 of N, which count the remaining space to the opposite margin (positive 486 values of N still count the space used since the start of the prompt). 487 In PS1 and PROMPT, this counts to the right margin, whereas in RPS1 and 488 RPROMPT, it counts to the left margin (not to the opposite prompt). 489 490- Also in prompt strings, %e or the equivalent test %(e..) are used to 491 output or test the execution / evaluation depth of a shell 492 construct within functions etc. This is useful in $PS4. 493 494- Another new prompt feature is the %. escape within time strings, for 495 example %D{%H:%M:%S.%.}. It provides zero-padded decimal fractions of a 496 second; by default milliseconds are shown, but the number of digits may 497 be indicated from 1 to 6, e.g. "%6.". (Note this is part of the 498 extensions to strftime() formats rather than basic prompt escapes.) 499 500- The operators :^ and :^^ in parameter substitution allow for array 501 zipping in the form ${name:^array}. With the :^ operator, all entries 502 in $name and $array will be output in alternating order. With :^ the 503 longer array is trimmed whereas the :^^ operator repeats the shorter 504 array enough to match the longer array. 505 506- The value of $? when a job becomes stopped is now the signal number plus 507 128, for compatibility with other shells. Note that different operating 508 systems use different values e.g. for SIGTSTP, so it is not possible in 509 portable scripts to detect stopped jobs by comparing to a fixed number. 510 Also, the value of $pipestatus is now updated when a job stops, not just 511 when it exits. 512 513- Redirections applied to function definitions take effect when the 514 function is executed, not when it is defined. Other shells already 515 work this way. For example, 516 fn() { echo hello } >~/logfile 517 Running fn writes "hello" to logfile. In older versions of the shell 518 it would create an empty file at the point of definition. 519 520Changes between 4.2 and 5.0.0 521----------------------------- 522 523The following changes first appeared in the 4.3 series of releases; 524see also the file Etc/NEWS-4.3. 525 526Here is a summary of the most significant changes: 527 528- Multibyte characters strings are supported throughout the shell. 529 Various options, editor features, and expansion flags have been 530 added to aid in using them. 531 532- The following new options have appeared: COMBINING_CHARS, 533 DEBUG_BEFORE_CMD, HASH_EXECUTABLES_ONLY, HIST_FCNTL_LOCK, 534 HIST_LEX_WORDS, HIST_SAVE_BY_COPY, MULTIBYTE, NO_MULTI_FUNCDEF, 535 PATH_SCRIPT, POSIX_ALIASES, POSIX_CD, POSIX_JOBS, POSIX_STRINGS, 536 POSIX_TRAPS, PROMPT_SP, SOURCE_TRACE. 537 538- Highlighting and colouring of the command line is supported. 539 540- Job control is supported in non-interactive shells and subshells. 541 542- The zshroadmap manual page provides a slightly more helpful 543 introduction to the shell manual than was previously available. 544 545- There have been some notable enhancements to POSIX comptability 546 when the shell is in a corresponding emulation (e.g. "emulate sh"). 547 548Expansion (parameters, globbing, etc.) and redirection 549-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 550 551- The character group tests [[:IDENT:]], [[:IFS:]], [[:IFSSPACE:]], 552 [[:WORD:]] in patterns allow testing if a character can be 553 part of an identifier, is an IFS character, is an IFS whitespace 554 character, or is considered part of the word using the line editor's 555 logic based on the shell variable WORDCHARS. 556 557- In extended globbing, "(#cN,M)" means "match the preceding group 558 at least N but no more than M times". 559 560- The glob qualifier P can be used with an argument to add an extra 561 word before each glob match. 562 563- The syntax ~[...] provides dynamic directory naming by means 564 of the shell function zsh_directory_name or associated hook functions. 565 This is useful for expanding paths with many variable components as 566 commonly found in software development. 567 568- Parameter substitution has the ${NAME:OFFSET} and ${NAME:OFFSET:LENGTH} 569 syntax for compatibility with other shells (and zero-based indexing 570 is used to enhance compatibility). LENGTH may be negative to count 571 from the end. 572 573- The arbitrary limit on parameter subscripts (262144) has been removed. 574 As it was not configurable and tested in an inconvenient place it 575 was deemed preferable to remove it completely. The limit was originally 576 introduced to prevent accidental creation of a large parameter array 577 by typos that generated assignments along the lines of "12345678=0". 578 The general advice is not to do that. 579 580- The parameter substitution flag (D) abbreviates directories in parameters 581 using the familiar ~ form. 582 583- The parameter substitution flag (g) can take delimited arguments o, e and 584 c to provide echo- and print-style expansion: (g::) provides basic 585 echo-style expansion; (g:e:) provides the extended capabilities of 586 print; (g:o:) provides octal escapes without a leading zero; (g:c:) 587 additionally expands "^c" style control characters as for bindkey. 588 Options may be combined, e.g. (g:eoc:). 589 590- The parameter substitution flag (m) indicates that string lengths used 591 calculated by the (l) and (r) flags or the # operator should take 592 account of the printing width of characters in multibyte mode, whether 593 0, 1 or more. (mm) causes printing characters to count as 1 and 594 non-printing characters to count as 0. 595 596- The parameter substitution flag (q-) picks the most minimal way of 597 quoting the parameter words, to make the result as readable as possible. 598 599- The parameter substitution flag (Z), a variant of (z), takes arguments 600 describing how to split a variable using shell syntax: (Z:c:) parses 601 comments as strings (the default is not to treat comment characters 602 specially); (Z:C:) parses comments and strips them; (Z:n:) treats 603 newlines as ordinary whitespace (the default is to turn unquoted 604 newlines into semicolons; this is now documented). 605 606- The parameter subscript flag (e) forces the argument to be treated 607 as a string, never a pattern, e.g. ${array[(ie)*]} looks for the 608 index of the array element containing the literal string "*". 609 610- The operators :| and :* in parameter substitution allow for array 611 subtraction and intersection in the form ${name:|array}. With the :| 612 operator, all entries in $name that are also in $array will be removed 613 from the substitution. Conversely for the :* operation only the 614 entries that are in both arrays will be substituted. 615 616- Numeric expansions can have a positive or negative step 617 e.g. "{3..9..2}". Negative start and end of ranges are also now 618 supported. 619 620- =(<<<...) is optimised to eliminate the need for an external process. 621 It writes the given string to a file and substitutes the name on the 622 command line. 623 624- The redirection operations "{myfd}>file" and "{myfd}>&-" open and 625 close a new file descriptor (at least 10) contained in the shell 626 variable myfd, which can be written to with ">&$myfd". This allows 627 arbitrary file descriptors rather than the explicit range 0 to 9. 628 629- New prompt escapes: 630 %x and %I show source file and line number, useful in $PS4 (the 631 existing %N and %i show names and lines in the execution environment 632 rather than the source file). 633 %F, %K, %f, %k allow colouring of prompts both using ANSI colour names 634 and values supported by individual terminal emulators. 635 636Builtins and shell functions 637-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 638 639- Directory-changing builtins take an option -q to suppress side 640 effects such as printing directories or calling the chpwd hook functions. 641 642- Various enhancements have been made to traps: 643 - The option DEBUG_BEFORE_CMD is on by default, so DEBUG traps 644 can be used to debug code about to be run 645 - $ZSH_DEBUG_CMD in such a trap gives the code to be run 646 - "setopt ERR_EXIT" in a DEBUG trap causes the code not to be executed 647 648- The "fc" builtin is now more useful non-interactively. 649 650Shell variables (parameters) 651-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 652 653- New variables: 654 CORRECT_IGNORE can be set to a pattern to be ignored in spelling correction. 655 KEYBOARD_HACK defines characters to be ignored if typed unmatched at 656 the end of the line (an extension of the SUN_KEYBOARD_HACK option, 657 but note that setting the option will override the variable). 658 ZSH_PATCHLEVEL provides a unique indication of the code compiled to 659 make the shell, even between releases. 660 ZSH_SUBSHELL indicates the subshell level, incremented once per fork, at 661 which the code is being run. 662 663Options 664-+-+-+- 665 666- New options: 667 COMBINING_CHARS: assume that the terminal displays combining 668 characters correctly. The shell cannot determine this by itself, 669 hence the option. This is highly recommended for MacOS X where 670 file names are stored with accented characters split into basic 671 and combining characters. 672 DEBUG_BEFORE_CMD (on by default): execute debug traps before the 673 code they refer to. This is a change of the default behaviour 674 as the new behaviour is much more useful. 675 HASH_EXECUTABLES_ONLY: don't insert non-executable files into the 676 command hash used e.g. by completion; this is optional as the 677 resulting behaviour may be very slow on network paths. 678 HIST_FCNTL_LOCK: Use the system's file locking mechanism instead 679 of an ad-hoc mechanism for locking history files. 680 HIST_LEX_WORDS: Perform lexical analysis on history lines read from 681 files, so the words are more accurately determined. May be very slow. 682 HIST_SAVE_BY_COPY (on by default): if unset, write a history file in 683 place by truncating the old one. Only needs to be turned off in 684 special circumstances. 685 MULTIBYTE (on by default if available): both variables and editor 686 command lines are treated as sequences of multibyte characters 687 rather than raw bytes depending on the locale. May be turned off 688 within functions to perform bytewise operations. 689 MULTI_FUNCDEF (on by default): "foo bar () { ... }" defines two 690 functions. This is often found to be confusing and bug-prone, 691 so you may want to unset it. 692 PATH_SCRIPT: search the path for a script specified as the first 693 argument to the shell on invocation. 694 POSIX_ALIASES: reserved words are not candidates for alias expansion. 695 POSIX_CD: make directory changing more POSIX-compatible. 696 POSIX_JOBS: make job control more POSIX compliant. 697 POSIX_STRINGS: $'...\0...' always processes \0 as a NULL, but if the 698 option is set the remainder of the string is ignored. 699 POSIX_TRAPS: EXIT traps are not executed on return from shell functions. 700 PROMPT_SP: improves display of lines not ending with newlines when 701 PROMPT_CR is in effect. 702 SOURCE_TRACE: print information as files are executed with ".", 703 "source", or as startup or shutdown files. 704 705Line editor 706-+-+-+-+-+- 707 708- Supports multibyte characters, including characters wider than one 709 screen cell and (with the COMBINING_CHARS option) combining characters. 710 711- New builtin widgets: 712 arguments-base: allow non-decimal numeric arguments 713 history-incremental-pattern-search-{backward,forward}: support 714 patterns in incremental searches. 715 716- New special variables: 717 region_highlight allows arbitrary highlighting of parts of the 718 command line; it is maintained dynamically. 719 UNDO_CHANGE_NO gives a unique record of the current change state of 720 the command line, for undoing back to a particular point using 721 the undo widget. 722 zle_highlight provides master control of highlighting for special 723 modes, e.g. unprintable characters. 724 ZLE_LINE_ABORTED records an editor line that was aborted by an error 725 or C-g. It can be used to recover aborted lines. 726 ZLE_STATE give miscellaneous information, currently whether the line 727 editor is in insert or overwrite mode. 728 729- The undo widget takes an argument, a previous value of $UNDO_CHANGE_NO. 730 731Completion 732-+-+-+-+-+ 733 734- Many new and enhanced completion functions 735 736- New styles: 737 accept-exact-dirs: suppress path expansion of directory components 738 that already exist, speeding up completion significantly on slow 739 network directories. 740 path-completion: can be used to suppress directory components before 741 the current one completely, so e.g. /u/b<TAB> only completes after the 742 "b", not the "u". 743 744- New special variables: 745 ZLE_REMOVE_SUFFIX_CHARS, ZLE_SPACE_SUFFIX_CHARS provide enhanced 746 flexibility over suffix removal. 747 748- Matching control, typically handled with the matcher-list style, 749 supports named character ranges, such as [:upper:], wherever 750 ranges were allowed, for example 'm:{[:upper:]}={[:lower:]}'. 751 However, matching control does not yet handle multibyte characters 752 properly, so this is currently limited to ASCII. 753 754Syntax and compatibility 755-+-+-+-+-+-+-+-+-+-+-+-+ 756 757- Substitutions of the form ${var:-"$@"} and ${var:+"$@"} now behave 758 much more like other shells when appropriate (e.g. with the 759 SH_WORD_SPLIT option). 760 761- Assignments within variable substitutions, such as ${var=value}, 762 are also more compatible with other shells where appropriate. 763 764- The emulate command can now be passed an expression to be evaluated 765 in a "sticky" emulation, so that functions defined there always 766 behave in the appropriate emulation. 767 768- "emulate sh" and similar modes have improved compatibility with 769 respect to deciding whether the shell should exit on errors. 770 771- Signals now accept SIG as part of the name. 772 773Modules 774-+-+-+- 775 776- Modules now present "features", specific builtins (b:), parameters 777 (p:), conditions (c:) and math functions (f:), allowing more control 778 over what is imported from a module. 779 780- The zsh/curses module provides access to the "curses" screen 781 manipulation package. 782 783- The zsh/datetime module has a calendar utility, although it is not 784 as robust as standalone calendar utilities. 785 786- The zsh/newuser module and associated functions has facilities for 787 setting up startup files for a first-time user. 788 789- The zsh/parameter module contains some new arrays to aid in tracing 790 of the shell's call stack: $funcsourcetrace and $funcfiletrace. 791 792- The zsh/parameter module provides $usergroups, an associative arrays 793 whose keys are the names of groups the current user belongs to, with 794 the group identifier as the corresponding value. 795 796- The zsh/system module has a zsystem builtin which provides file 797 locking and also a forward-compatible means for testing subcommands 798 supported. 799 800Internal improvements 801-+-+-+-+-+-+-+-+-+-+- 802 803- High resolution timestamps are used internally for certain 804 comparisons when available. 805 806Add-on functions 807-+-+-+-+-+-+-+-+ 808 809- The VCS_Info system provides a way of keeping track of the state 810 of numerous version control systems within the shell. 811 812- cdr etc.: change to a directory from a list that persists between 813 shell instances, with completion support. 814 815- regexp-replace replaces text in variables using regular expressions; 816 it may be used by zle function widgets based on the functions 817 replace-string and replace-string-again to provide regular expression 818 replacements in the line editor. 819 820 821Changes in 4.2 since version 4.2.0 822---------------------------------- 823 824- The autoload and related builtins take options -k and -z to indicate 825 ksh or zsh autoloading style for given functions, making it possible 826 to mix and match. 827 828- Assignments to associative arrays can use the i and r index flags. 829 For example, 830 assoc[(i)alpha*]=bravo 831 sets the value for the element whose key matches the pattern `alpha*'; 832 assoc[(r)activ*]=passive 833 sets the value for the element whose current value matches the pattern 834 `activ*'. 835 836- The glob qualifier F indicates a non-empty directory. Hence *(F) 837 indicates all subdirectories with entries, *(/^F) means all 838 subdirectories with no entries. 839 840- fc -p and fc -P provide push/pop for the status of the shell's 841 history (both internal and using the history file). With automatic 842 scoping (fc -ap) it becomes easy to use a temporary history in a 843 function. This has been added to the calculator function zcalc to make 844 its internal history work more seamlessly. 845 846- A new `try block' and `always block' syntax has been introduced 847 to make it easier to ensure the shell runs important tidy-up code 848 in the event of an error. It also runs after a break, continue, or 849 return, including a return forced by the ERR_RETURN option 850 (but not an exit, which is immediate). The syntax is: 851 `{' try-block-list `}' `always' `{' always-block-list `}' 852 where no newline or semicolon may appear between `}' and `always'. 853 This is compatible with all previous valid zsh syntax as an `always' 854 at that point used to be a syntax error. For example, 855 { echo Code run in current shell } always { echo Tidy-up code } 856 857- A new zle widget reset-prompt has been added to re-expand the current 858 prompt. Changes to the variable in use as well as changes in its 859 expansions are both taken into account. The same effect is now forced by 860 a job change notification, making the %j prompt escape and %(j..) ternary 861 expression more useful. 862 863- The zftp module supports ports following the hostname in the normal suffix 864 notation, `host:port'. This requires IPv6 colon-style addresses to be 865 specified in suitably quoted square brackets, for example: 866 867 zftp open '[f000::baaa]' 868 zftp open '[f000::baaa]:ftp' 869 870 (the two are equivalent). 871 872- Special traps, those that don't correspond to signals, i.e. ZERR, DEBUG 873 and EXIT are no longer executed inside other traps. This caused 874 unnecessary confusion if, for example, both DEBUG and EXIT traps 875 were set. The new behaviour is more compatible with other shells. 876 877- New option TRAPS_ASYNC which if set allows traps to run while the 878 shell is waiting for a child process. This is the traditional zsh 879 behaviour; POSIX requires the option to be unset. In sh/ksh 880 compatibility mode the option is turned off by default and the option 881 letter -T turns it on, for compatibility with FreeBSD sh. 882 883- New WIDGETSTYLE, WIDGETFUNC parameters in ZLE. 884 885- Glob qualifier (+func) is shorthand for (e:func:) (calls a command, 886 typically a shell function, with no argument). 887 888 889New features between zsh versions 4.0 and 4.2 890--------------------------------------------- 891 892Configuration: 893- upgraded to use autoconf post-2.50 894- improved compatibility with other shells through shell options, 895 builtin arguments and improved builtin option parsing 896 897Syntax and builtins: 898- new printf builtin 899- `+=' to append to parameters which works for scalars, arrays and (with 900 pairs) associative arrays. 901- enhanced multiple parameter `for' loops: 902 for key value in key1 value1 key2 value2 ... 903 maintaining full compatibility with POSIX syntax. 904- Suffix aliases allow the shell to run a command on a file by suffix, 905 e.g `alias -s ps=gv' makes `foo.ps' execute `gv foo.ps'. Supplied 906 function zsh-mime-setup uses existing mailcap and mime.types files 907 to set up suitable aliases. Supplied function pick-web-browser is 908 suitable for finding a browser to show .html etc. files by suffix alias. 909- new option `no_case_glob' for case-insensitive globbing. 910 911Add-on modules and functions: 912- zsh/datetime modules makes date formatting and seconds since EPOCH 913 available inside the shell. 914- zsh/net/tcp module provides builtin interface to TCP through ztcp 915 builtin. Function suite for interactive and script use with expect-style 916 pattern matching. 917- zsh/net/socket module provides zsocket builtin. 918- zcalc calculator function with full line editing. 919- builtin interface to pcre library 920- zsh/zselect module provides zselect builtin as interface to select 921 system call 922 923Completion system: 924- general improvements to command and context support, low-level functions, 925 display code. 926- in verbose mode, matches with the same description are grouped 927- highly configurable completions for values of specific parameters, 928 specific redirections for specific commands 929- support for bash completion functions (typically zsh native functions are 930 more powerful where available) 931- New completions provided for (some of these may be in later 4.0 932 releases): valgrind, tidy, texinfo, infocmp, Java classes, larch, limit, 933 locale parameters, netcat, mysqldiff, mt, lsof, elinks, ant, debchange 934 (dch), email addresses, file system types, Perforce, xsltproc. 935 Plus many others. 936 937Line editor: 938- special parameters $PREDISPLAY, $POSTDISPLAY available in function 939 widgets to configure uneditable text (for narrowing) 940- recursive editing 941- supplied widgets read-from-minibuffer, replace-string use these features 942 (more intuitive prompting and argument reading than 4.0) 943- access to killed text via $CUTBUFFER and $killring 944- supplied highly configurable word widgets forward-word-match etc., can 945 set what constitutes a word interactively or in startup script 946 (implement bash-style behaviour, replacing previous bash-* word widgets) 947- interface to incremental search via $LASTSEARCH 948- better handling of keymaps in zle and widgets 949- better support for output from user-defined widgets while zle is active 950- tetris game which runs entirely in zle 951- several other contributed widgets 952 953Local internal improvements: 954- disowned jobs are automatically restarted 955- \u and \U print escapes for Unicode 956- read -d <delimiter> allows a custom line ending. 957- read -t <timeout>. 958- line numbers in error messages and $PS4 output are more consistent 959- `=prog' expands only paths, no longer aliases for consistency 960- job display in prompts; `jobs' command output can be piped 961- prompts: new $RPROMPT2, %^, %j, %y, enhanced %{, %}, %_. 962- rand48() function in zsh/mathfunc for better randomness in arithmetic 963 (if the corresponding math library function is present) 964- $SECONDS parameter can be made floating point via `typeset -F SECONDS' 965 for better timing accuracy 966- improvements to command line history mechanism 967- job table is dynamically sized, preventing overflow (typically seen 968 previously in complex completions). 969- many bugfixes 970 971 972New features in zsh version 4.0.1 973--------------------------------- 974 975Compared with 3.1.9, there are mostly incremental improvements to 976 - the new completion system --- more functions, completers, styles... 977 - the line editor 978 - handling of signals and traps 979 - the configuration system, particularly for modules 980 - Cygwin support (now essentially complete) 981 - arithmetic evaluation 982 - the zpty (pseudoterminal handling) module 983 - the test suite 984plus various bug fixes and compatibility improvements. 985 986The alias modules (zle.so as an alias for zsh/zle.so, etc.) have been 987removed; use `zmodload -A' to load modules under other names. This is 988irrelevant if you are upgrading from 3.0. 989 990Compared with the 3.0 series of releases (the last stable set), the most 991significant of a large number of improvements in the shell are: 992 - Dynamically loadable modules with hierarchical naming system 993 - Shell functions as editor functions, with much additional builtin support 994 - Incredibly rich new completion system; just needs a single 995 initialization command to provide completion for all sorts of commands 996 and contexts 997 - Associative arrays 998 - Lots of new features in parameter substitution and globbing; more 999 logical handling of nested parameter substitutions 1000 - Rewritten pattern-matching (globbing) code supports approximate 1001 and case-insensitive matching and backreferences 1002 - Various custom modules for pty's, FTP, special parameters, etc. 1003 - Rewrites of many internal parts of the code: execution code to 1004 provide compilation to internal representation, pattern matching 1005 - Floating point arithmetic and mathematical functions module 1006 - A test suite 1007 - Various new options for compatibility with this, that and the other 1008See the 3.1.x changes below for more detail. 1009 1010 1011New features in zsh version 3.1.8 and 3.1.9 1012------------------------------------------- 1013These are primarily bug-fix versions. There are only a few user-visible 1014changes. 1015 - Array slices ${array[a,b]} with b < a now correctly have zero length. 1016 1017 1018New features in zsh version 3.1.7 1019--------------------------------- 1020Further enhancements to new completion system: 1021 - Comprehensive context-sensitive configuration via `styles', which 1022 can be set by the menu-driven front end in compinstall 1023 - General mechanism for setting patterns to be ignored in a completion; 1024 overriding of patterns to be matched for functions 1025 - New completers: _prefix to complete word before cursor, _ignored 1026 to complete using words so far ignored (like $fignore but more 1027 powerful), _history to complete words from shell history 1028 - Multiple use of completers with different options, similarly splitting 1029 of different types of completion (`tags') so they are considered with 1030 different styles 1031 - Many more supplied completions for standard commands which work out of 1032 the box, and better handling of command line options/arguments which 1033 behave in the usual way 1034 - $fpath now set up to use installed functions by default; functions 1035 can be loaded just by `autoload -U compinit; compinit' 1036 - Much improved handling of nested quoting and nested braces 1037 - New LIST_PACKED and LIST_ROWS_FIRST completion options and corresponding 1038 styles 1039 - compctl library separated out (frozen but still supported) 1040 - User-friendly introduction available at zsh website 1041 http://zsh.sourceforge.net/ 1042 1043Additions to complist listing library (coloured completion and menu 1044selection): 1045 - Listings can be shown page by page (are by default for new completion) 1046 - Menu selection allows full up and down scrolling of long lists 1047 1048Other editing features: 1049 - new parameters $PENDING, $MARK, $BUFFERLINES 1050 - Easy display of a prompt from within an editing widget 1051 1052Code parsing, storing and execution: 1053 - Completely new system of storing code internally, greatly optimised 1054 - Much less memory for shell functions etc. 1055 - Can compile shell functions to .zwc `wordcode' functions for fast 1056 loading 1057 - Can create `digest' files of entire directories in .zwc format 1058 1059Parameters: 1060 - Floating point support added, similar to ksh93, `typeset -F' and 1061 `typeset -E' declare floating point variables; usual C/Fortran-like 1062 rules for integer/float conversion 1063 - Mathematical library zsh/mathfunc contains all the standard mathematical 1064 functions for use in arithmetical expressions 1065 - Improved parsing of arithmetical expressions and better error messages 1066 - Special parameters can be made local 1067 - `typeset -h' hides specialness of parameters, either as parameter 1068 attribute or when declaring new local variable 1069 - Local parameters can now be exported as in other shells; new option 1070 GLOBAL_EXPORTS on by default provides old behaviour that `typeset -x' 1071 referred to global parameters. 1072 - zsh/parameter module enhanced: now needed for new completion; parameters 1073 provided have `-h' flag set so that they are hidden by `typeset', so 1074 that existing functions don't need to be changed 1075 - Quotes can be stripped from parameter values with ${(Q)...}, providing 1076 reverse of ${(q...)...} facility 1077 1078Globbing and pattern matching: 1079 - Pattern matching rewritten for efficiency 1080 - Supports `backreferences', i.e. extracting parenthesised chunks of 1081 matches, e.g. 1082 [[ $foo = (#b)(*/)[^/]* ]] 1083 stores the part of $foo up to the last / in $match[1] and the indexes of 1084 the match in $mbegin[1], $mend[1]. (#m) is also available to set $MATCH 1085 to the entire match and corresponding $MBEGIN, $MEND: useful in 1086 parameter substitutions like ${.../.../...}. 1087 - (#s) and (#e) match start and end of pattern like ^ and $ in regular 1088 expression, useful in complex expressions such as ((#s)|/)dirname((#e)|/) 1089 and in parameter expressions. 1090 1091 - Depth-first/last listing of recursive glob lists 1092 1093Functions etc.: 1094 - `autoload -X' inside a function body instructs the shell to 1095 bootstrap the function at that point 1096 - `autoload +X fn' says load the function fn but don't execute it 1097 - Prompt `themes' make customization of prompts easier 1098 1099Modules: 1100 - New hierarchical naming scheme for modules; supplied modules go into 1101 zsh subdirectory, so zle becomes zsh/zle etc.; aliases supplied for 1102 compatibility for existing code, but the new format should be used in 1103 future. 1104 - zmodload is more consistent between dynamically and statically linked 1105 shells 1106 - zsh/zftp and its function suite support multiple sessions (zfsession 1107 command); zftransfer allows transfer of files between two ftp sessions 1108 with no local file; use styles for e.g. progress style; IPv6 supported; 1109 recursive put `zfput -r' for uploads 1110 - zsh/zpty module creates pseudoterminal and allows builtin `expect'-like 1111 behaviour 1112 1113Other: 1114 - Test suite, not yet complete (`make test') 1115 - use of Linux task limits 1116 - Many fixes including output redirection with `setopt xtrace' and 1117 other redirection fixes; NIS+ problem. 1118 - Better null-command behaviour in sh and csh emulation 1119 - Internal memory usage optimisations 1120 1121 1122New features in zsh version 3.1.6 (beta version) 1123------------------------------------------------ 1124Note also the changes for 3.0.6, which include changes between 3.1.5. and 11253.1.6. 1126 1127New completion system via shell functions; massive degree of 1128programmability and configurability: 1129 - ready-made function suite to use, see zshcompsys(1) 1130 - approximate completion and spelling correction via completion 1131 - control over matching for case-independence, partial word completion, etc. 1132 - menu selection: choose a completion by moving the cursor 1133 - coloured completion lists 1134 - completion of filenames in quotes is now more reliable; splitting 1135 quoted strings into command arguments is also possible. 1136 1137Other editing changes: 1138 - enhancements to function/editing interface: new parameters, numeric 1139 arguments, string argument passing, reading keys from widgets. 1140 - the old history-search-{back,for}ward behaviour and bindings have 1141 returned (up to minor details). 1142 - BASH_AUTO_LIST option to show completion list only on second key press. 1143 - the ZBEEP parameter gives a string to output instead of beeping, 1144 allowing you to have a visual bell. 1145 1146History changes: new options HIST_NO_FUNCTIONS, HIST_EXPIRE_DUPS_FIRST, 1147HIST_FIND_NO_DUPS, HIST_IGNORE_ALL_DUPS, INC_APPEND_HISTORY, 1148HIST_SAVE_NO_DUPS, SHARE_HISTORY, allow better control of when history is 1149read and written and how duplicates are handled. New format for history 1150saves. 1151 1152Associative arrays plus enhanced parameter substitutions to retrieve keys 1153and values. 1154 1155Globbing changes: 1156 - Case-insensitive and approximate globbing. 1157 - Ordering and indexing of globbing matches, e.g. *(om[1]) picks 1158 most recently modified file. 1159 - General file mode qualifier with chmod(1)-like syntax, e.g. *(f:u+wx:) 1160 1161New loadable modules: 1162 - zftp, plus associated function suite, for turning your zsh session 1163 into an FTP session too 1164 - parameter, for examining and altering shell hash tables via an 1165 associative array interface. 1166 - mapfile, for reading and writing external files via an associative 1167 array interface. 1168 1169Debugging and prompt enhancements: 1170 - $PS4 can contain %i for $LINENO as well as %N for script or function 1171 names (default PS4 changed), also %_ for current shell structure 1172 executing; 1173 - Prompt truncation %<...< is now more flexible: it applies to a 1174 whole section of the prompt, not just one escape. You need to put 1175 %<< after the truncated escape to get the old behaviour. 1176 - %20(l.yes.no) in prompts prints yes if at least 20 characters have 1177 been output, else no (e.g. for outputting extra newlines). 1178 1179Parameter and expansion changes 1180 - `typeset -t MYPATH mypath' creates tied path/PATH-like variables 1181 - `typeset -g' allows operations on parameters without making them local 1182 - New expansions 1183 - ${(t)param} prints type information for $param 1184 - ${(P)param} treats value of $param as the name of a param to 1185 substitute 1186 - ${foo:q} can quote replaced parameter text from expansion 1187 - ${foo/old/new} substitution, like bash; also (S) flag for shortest 1188 match 1189 - $foo[(b.2.i)bar] starts searching $foo for bar starting at 2nd match 1190 1191Builtin and function changes 1192 - stat module: `stat -H hash foo' gives you e.g. $hash[mtime] 1193 - `autoload -U' autoloads functions without alias expansion. 1194 1195Other new options: 1196 - LOCAL_TRAPS allows signal traps to be local to functions (as in ksh). 1197 - NO_RCS can now be turned on at any point in initialization files. 1198 - NO_GLOBAL_RCS can force /etc/z* files after /etc/zshenv to be skipped. 1199 (Please don't use this as an excuse to stuff more into /etc/zshenv!) 1200 - Existing MAGIC_EQUAL_SUBST option is more useful; any argument containing 1201 ...=~...:~... will perform filename expansion on the ~ (previously, 1202 the string before `=' had to look like a parameter name). 1203 1204Configuration changes: 1205 - Generation of signal names should be more reliable 1206 - Customizable installation of shell functions from distribution. 1207 1208 1209New features in zsh version 3.0.6 1210--------------------------------- 1211 1212Most of these changes are designed to improve compatibility with zsh 1213version 3.1.6, the latest development release. However, this release also 1214fixes all known Year 2000 (Y2K) bugs in zsh 3.0. 1215 1216History changes: 1217 - whitespace between words is ignored in history searches. 1218 - new option HIST_REDUCE_BLANKS removes extra whitespace in the stored 1219 history. 1220 - support for reading (but not writing) version 3.1.6 history files. 1221 1222Globbing changes: 1223 - the a, c, and m glob qualifiers can now test time in seconds. 1224 - globbing of number ranges behaves more like character ranges in that 1225 it can match a prefix of a number, e.g. `<1-5>*' matches 1, 2, 3, 4, 1226 5, 17, 23skiddoo, 5986, etc., but not 6, 7, 8ball, 911, etc. 1227 1228Parameter and expansion changes: 1229 - expansion of ~ and other globbing flags via ${~param} do not depend 1230 upon EXTENDED_GLOB (bug fix). 1231 - nested parameter substitutions require braces (this was always the 1232 documented behaviour, but previous parsers didn't enforce it). 1233 - quote only nested expansion, e.g. ${(f)"$(<file)"} reads complete 1234 `file', then splits lines into array. 1235 1236Builtin and function changes: 1237 - `typeset -U' works on the colon-array version of linked parameters. 1238 - `typeset +f' and `functions +' output the names (only) of functions. 1239 - `emulate -L' has the effect of `setopt localoptions'. 1240 - in fn1() { local foo; unset foo; foo=bar; }, foo is restored at local 1241 level, whereas if the `unset foo' appeared in a nested function it 1242 would have been restored at global level, which was presumably wrong. 1243 - `foo=bar >&file' is a redirection, not a NULLCMD. 1244 - any single complex command, such as `case ... esac', parses as if 1245 semicolon-terminated (bug fix). 1246 - the shell function `preexec', if defined, is run after parsing each 1247 command line but before executing the command. 1248 1249Other changes: 1250 - the option PRINT_EIGHT_BIT causes zsh to emit raw bytes in prompts 1251 and completion lists even if the system ctype(3) package says that 1252 those bytes are not "printable." 1253 1254Debugging enhancements: 1255 - LINENO is now very much more useful in scripts and functions and is 1256 reported correctly in most error messages. 1257 - ERREXIT behaviour is now consistent with newer Bourne-like shells, 1258 e.g. with respect to `if' tests that fail. 1259 1260Configuration changes: 1261 - Large file and 64-bit integers on 32-bit machines supported where 1262 provided by OS. 1263 - a few more system features, such as getpwnam/getpwuid, are tested for. 1264 1265 1266New features in zsh version 3.1 (beta version) 1267---------------------------------------------- 1268 1269On most operating systems zsh can load binary modules dynamically at 1270run-time. ZLE and the compctl builtin are now reside in a separate 1271module which is loaded automatically on demand. 1272 1273for ((expr; expr; expr)) do ... done loop syntax from AT&T ksh93 is 1274now supported. 1275 1276POSIX globbing character classes ([:alnum:] etc.) are now supported. 1277 1278ksh's case fall-through feature (;&) is supported. 1279 1280ksh93's $'' quoting syntax is supported. 1281 1282Restricted mode is now supported. This is controlled by the new option 1283RESTRICTED (-r). 1284 1285New options BARE_GLOB_QUAL, HIST_NO_FUNCTIONS (alias NO_LOG), KSH_GLOB, 1286PRINT_EIGHT_BIT, PROMPT_BANG, PROMPT_PERCENT, RM_STAR_WAIT. 1287 1288Options ALWAYS_LAST_PROMPT, APPEND_HISTORY, AUTO_LIST, AUTO_MENU, 1289AUTO_PARAM_KEYS, AUTO_PARAM_SLASH, AUTO_REMOVE_SLASH, LIST_AMBIGUOUS 1290and LIST_TYPES are now on by default. 1291 1292In ZLE, arbitrarily many keymaps can be defined. Multi-character 1293keybindings now work. 1294 1295Completion can be performed within a brace expansion. 1296 1297EMACS-like universal-argument function. 1298 1299 1300New features in zsh version 3.0 1301------------------------------- 1302 1303Trailing "/" in a glob pattern now works like in other shell thus it 1304can no longer be used as a shorthand for "(/)". 1305 1306Much improved sh/ksh emulation. When zsh is invoked as sh it mostly 1307conforms to POSIX 1003.2. 1308 1309Enhanced parameter expansion features: new flags: A, @, e, W, p, f, F. 1310Expansions can be nested. For example, 1311"${${(M)${(f@)$(<builtin.pro)}:#char*}[2][(w)3]}" expands to the third 1312word of the second line of builtin.pro which begins with char. See 1313zshexpn(1) for the details. 1314 1315***/foo glob does recursive directory search following symbolic links. 1316 1317Traps defined by the trap builtin are now executed in the current shell 1318environment and not as a shell function. This means that $1 is not set 1319to the signal number. Of course the TRAPxxx functions continue working 1320as before. 1321 1322Traps defined by the trap builtin are reset to their default values in 1323subshells. 1324 1325Option names can be prefixed by `no' to unset an option. 1326setopt no_option_name is the same as unsetopt option_name. 1327This change affects the output of the setopt and unsetopt 1328builtins when these are invoked without arguments. See 1329the zshoptions manual page for more explanation. 1330 1331!, {, } and [[ are now reserved words. Things like [[-z $foo]] or {foo} 1332should not be used. {foo} still works if the IGNORE_BRACES option is not 1333set but this feature may be removed in the future. [[ -z $foo ]] and 1334{ foo } should be used instead. 1335 1336HOSTTYPE special parameter is removed. The new OSTYPE, MACHTYPE and 1337VENDOR parameters should be used instead. 1338 1339VERSION parameter is renamed to ZSH_VERSION 1340 1341exec now saves the history in interactive shells. If you do not like this 1342behaviour you can alias exec to 'unset HISTFILE ; exec'. 1343 1344${~spec}, ${=spec} and ${^spec} used to toggle the effect of 1345globsubst/shwordsplit/rcexpandparam. Now these force the corresponding 1346option on. ~, = or ^ can be doubled to force the relevant option off for 1347the substitution. 1348 1349Explicitly requested word splitting like ${=spec} or ${(s:delim:)spec} 1350will be executed even if the substitution is double quoted. 1351 1352The right-hand side of assignments are no longer globbed by default hence 1353assignment foo=* will assign '*' as a value of foo. Use the foo=( * ) 1354array assignment syntax to get the old behaviour. Alternatively the 1355GLOB_ASSIGN can be set to emulate the old behaviour but the usage of this 1356option is strongly discouraged and this option may be completely removed in 1357the future. 1358 1359foo=$bar no longer creates an array even if bar is an array. Use 1360foo=( $bar ) or even better, foo=( "$bar[@]" ) instead. 1361 1362When foo is an array parameter ${#foo} will always return the length of the 1363array even if the substitution is double quoted. ${(c)#foo} should be used 1364to get back the old behaviour. 1365 1366When the prompt_subst option is set prompts are fully expanded using 1367parameter expansion, command substitution and arithmetic expansion. 1368In 2.5 backquote substitution was not performed in the prompts so this 1369change might cause problems in some startup scripts if ` is used literally 1370in prompts. 1371 1372History substitution is now not performed if the history escape character 1373appears in a single-quoted string. This may break some interactive shell 1374functions which use \! in single-quoted strings. 1375 1376The UID, EUID, GID, EGID parameters can be assigned now. The assignment 1377executes the setuid(), seteuid(), setgid(), setegid() respectively. On 1378systems where setuid and seteuid is not supported these functions are 1379emulated using setreuid or setresuid which may result in a different 1380behaviour. 1381 1382Assigning the USERNAME parameter will call setuid(uid) where uid is the 1383user id of the specified user. 1384 1385The privileged (-p) option is automatically set on invocation if euid != uid 1386or egid != gid. If this option is set no user startup files are sourced. 1387The shell will drop privileges when this option is unset by resetting its 1388euid to uid and its egid to gid. 1389 1390The =number substitution for accessing the directory stack is changed to 1391~number to allow =command substitution when a command name begins with a 1392digit. 1393 1394<> is a redirection operator which opens the standard input for both 1395reading and writing. To match a number use <->. 1396 1397Option letters -1 and -C for PRINT_EXIT_VALUE and NO_CLOBBER are swapped: 1398`set -C' sets NO_CLOBBER and `set -1' sets PRINT_EXIT_VALUE. 1399 1400AUTO_PUSHD behaviour is changed. Now cd without arguments will always go 1401to the $HOME directory even if AUTO_PUSHD is set and PUSHD_TO_HOME is not 1402set. If you preferred the old behaviour you can alias cd to pushd. 1403 1404IFS word splitting with SH_WORD_SPLIT and the splitting of the input in the 1405read builtin has changed in cases when IFS contains characters other than 1406<space>, <tab>, <newline>. See the description of IFS in the zshparam 1407manual page for more details. 1408 1409 1410New features in zsh version 2.5 1411------------------------------- 1412 1413Greatly expanded completion possibilities. Programmable completion 1414allows detailed control over what arguments of what commands can be 1415completed to what. See dots/zcomp in the distribution for examples. 1416 1417Expand filenames with ~ and = on the right hand side of parameter 1418assignments. New option MAGIC_EQUAL_SUBST to do it in all 1419identifier=expression arguments. 1420 1421${+name} becomes 1 or 0 if name is set or unset. ${~spec} toggles 1422GLOB_SUBST in substitution. Parameter substitution takes lots 1423of flags in the format ${(flags)name}. 1424 1425New glob qualifiers for block/character special files, times in glob 1426qualifiers can be in months, weeks, days, hours, minutes. Qualifiers can 1427work on links or on what they point to. Qualifiers separated by commas 1428are or-ed. 1429 1430New parameter substitution modifiers (fFwW) to repeat actions. New 1431option CSH_JUNKIE_HISTORY. 1432 1433New line editor functions history-beginning-search-backward, 1434history-beginning-search-forward, expand-or-complete-prefix, push-input, 1435push-line-or-edit. 1436 1437Assign to part of a string, use qualifiers on string subscription with 1438$foo[(qual)2,5] 1439 1440New parameters: EGID, EUID, KEYTIMEOUT 1441 1442New prompt escape sequence %_ to get constructs like for and while in 1443the secondary prompt. %E in prompt clears to end of screen. 1444 1445Conditional expressions in PROMPT and WATCHFMT. 1446 1447New options ALWAYS_LAST_PROMPT, ALWAYS_TO_END, AUTO_PARAM_KEYS, 1448COMPLETE_ALIASES, COMPLETE_IN_WORD, CSH_JUNKIE_HISTORY, GLOB_SUBST, 1449LIST_AMBIGUOUS, MAGIC_EQUAL_SUBST, NO_FLOW_CONTROL, PROMPT_SUBST 1450 1451New option -m to many builtins makes arguments subject to pattern 1452matching. 1453 1454Bindkey can now bind both key sequences and prefixes of those. You can 1455for example bind ESC and function keys sending ESC sequences. 1456 1457Additional options to read builtin to use in functions called by 1458completion. 1459 1460New options to print to sort arguments and print them in columns. 1461 1462Some additional resource limits can be specified. 1463 1464Some editor functions now work in the minibuffer. 1465