{"id":13440704,"url":"https://github.com/zsh-users/zsh","last_synced_at":"2025-10-03T03:30:20.306Z","repository":{"id":37761876,"uuid":"2086459","full_name":"zsh-users/zsh","owner":"zsh-users","description":"Mirror of the Z shell source code repository.","archived":false,"fork":false,"pushed_at":"2025-01-20T19:06:44.000Z","size":38812,"stargazers_count":3720,"open_issues_count":8,"forks_count":448,"subscribers_count":98,"default_branch":"master","last_synced_at":"2025-01-20T20:20:57.215Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.zsh.org","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":"git://git.code.sf.net/p/zsh/code","source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zsh-users.png","metadata":{"files":{"readme":"README","changelog":"ChangeLog","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-07-22T00:29:19.000Z","updated_at":"2025-01-20T19:06:48.000Z","dependencies_parsed_at":"2024-04-07T15:25:46.539Z","dependency_job_id":"32f75727-fc24-4936-bd8d-87595501e547","html_url":"https://github.com/zsh-users/zsh","commit_stats":{"total_commits":12280,"total_committers":344,"mean_commits":35.69767441860465,"dds":0.7710097719869706,"last_synced_commit":"ec57ac0940c3f194c2c33e2860b2c2399d368837"},"previous_names":[],"tags_count":218,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsh-users%2Fzsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsh-users%2Fzsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsh-users%2Fzsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsh-users%2Fzsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zsh-users","download_url":"https://codeload.github.com/zsh-users/zsh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235069304,"owners_count":18930936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:01:25.329Z","updated_at":"2025-10-03T03:30:20.299Z","avatar_url":"https://github.com/zsh-users.png","language":"C","funding_links":[],"categories":["C","shell","Alternatives to `bash`","others","Terminal"],"sub_categories":[],"readme":"-----------------\nTHE Z SHELL (ZSH)\n-----------------\n\nVersion\n-------\n\nThis is version 5.10 of the shell.  This is a security and feature release.\nThere are several visible improvements since 5.9, as well as bug fixes.\nAll zsh installations are encouraged to upgrade as soon as possible.\n\nNote in particular the changes highlighted under \"Incompatibilities since\n5.9\" below.  See NEWS for more information.\n\nInstalling Zsh\n--------------\n\nThe instructions for compiling zsh are in the file INSTALL.  You should\nalso check the file MACHINES in the top directory to see if there\nare any special instructions for your particular architecture.\n\nNote in particular the zsh/newuser module that guides new users through\nsetting basic shell options without the administrator's intervention.  This\nis turned on by default.  See the section AUTOMATIC NEW USER CONFIGURATION\nin INSTALL for configuration information.\n\nFeatures\n--------\n\nZsh is a shell with lots of features.  For a list of some of these, see the\nfile FEATURES, and for the latest changes see NEWS.  For more\ndetails, see the documentation.\n\nIncompatibilities since 5.9\n---------------------------\n\nThe line editor's default keymap is now the \"emacs\" keymap regardless of the\nvalue of the environment variables $VISUAL and $EDITOR.  This only affects you\nif your $VISUAL or $EDITOR environment variable is set to a value that\ncontains the string \"vi\".  To get the previous behaviour, add\n\n    bindkey -v\n\nor, if your $VISUAL and $EDITOR environment variables vary,\n\n    if [[ ${VISUAL} == *vi* || ${EDITOR} == *vi* ]]; then\n        bindkey -v\n    else\n        bindkey -e\n    fi\n\nto your .zshrc file.  These snippets are compatible with previous\nversions of the shell.\n\nThe ERR_EXIT and ERR_RETURN options were refined to be more self-\nconsistent and better aligned with the POSIX-2017 specification of\n`set -e`:\n\n  - Function calls or anonymous functions prefixed with `!` now never\n    trigger exit or return. Negated function calls or anonymous\n    functions used to trigger exit or return if ERR_EXIT or ERR_RETURN\n    was set and the function call or anonymous function returned a\n    zero exit status. Example:\n\n      setopt ERR_EXIT\n      f() { true }\n      ! f\n      echo \"This is printed only since 5.10.\"\n\n  - The `always` command now ignores ERR_EXIT and ERR_RETURN, as other\n    complex commands do, if its exit status comes from a command\n    executed while the option is ignored. Example:\n\n      setopt ERR_EXIT\n      { false \u0026\u0026 true } always { echo \"This was and still is printed.\" }\n      echo \"This is printed only since 5.10.\"\n\n  - Function calls, anonymous functions, and the `eval`, `.`, and\n    `source` builtins now never ignore ERR_EXIT and ERR_RETURN on\n    their own. These commands used to ignore ERR_EXIT and ERR_RETURN\n    if their result came from a complex command (if, for, ...) whose\n    result came from a command executed while the option is\n    ignored. Example:\n\n      setopt ERR_EXIT\n      f() { if true; then false \u0026\u0026 true; fi }\n      f\n      echo \"This is printed only prior to 5.10.\"\n\n  - The `\u0026\u0026` and `||` operators now always ignore ERR_RETURN in their\n    left operand. Until this version, the operators failed to ignored\n    ERR_RETURN in their left operand if they were executed as part of\n    a function call or an anonymous function that was itself executed\n    in a context where ERR_RETURN is ignored. Example:\n\n      setopt ERR_RETURN\n      f() { { false; echo \"This is printed only since 5.10.\" } || true }\n      if f; then true; fi\n\nPCRE support is now PCRE2.\n\nParameter names may begin with a \".\" and follow a relaxed implementation\nof ksh namespace syntax.  Expansion of such parameters must use braces,\nthat is, in ${.param.name} form.  Parameters so named are excluded from\n`typeset` and `set` output unless explicitly listed in `typeset` arguments\nor matched by a pattern with `typeset -m`.\n\nInterpretation of exclusion-patterns following alternation-patterns has\nbeen rationalised.  This means for example that `[[ ab = (|a*)~^(*b) ]]`\nis true where previously it was false.\n\nImprovements to handling of terminal colors and attributes in prompts\nmay change the behavior of some prompt sequences, most notably in\ncases where `esq=${(%)...}` is used to capture an escape sequence.\n\nThe `which` and `functions` commands output function definitions in a\nformat independent of the MULTI_FUNC_DEF option.\n\nMath context no longer interprets a leading underscore as part of a\nnumeric constant.\n\nNul and characters greater than \\x77 are correctly handled by `read -d`.\n\nReturn values of `sysopen` from the zsh/system module have been updated\nto be more similar to other commands in that module.\n\nTied parameters created with the zsh/db/gdbm module may not be re-tied\nas locals in nested function scope.  This prevents database corruption\nwhen a function scope ends.\n\nIncompatibilities between 5.8.1 and 5.9\n---------------------------------------\n\ncompinit: A \"y\" response to the \"Ignore ... and continue?\" prompt removes\ninsecure elements from the set of completion functions, where previously\nit ignored the compaudit result and included all elements.\n\nBuild-time change: The default value of the --enable-gdbm configure\nargument has changed from \"yes\" to \"no\".  Thus, the zsh/db/gdbm module will\nnot be built unless --enable-gdbm is passed explicitly.\n\nvcs_info quilt: The value of the 'quiltcommand' style used to be taken for the\nname of an external command.  Now it may also be a shell function.  Normal\ncommand word precedence rules apply, so if you have a function and a command\nwith the same name, the function will be used.\n\nThe \"function\" reserved word, used to define functions, gained a new -T option.\nThat affects syntaxes such as:\n\n1. \"function -T { ... }\".  It used to define a function named \"-T\".  It\nnow defines and executes an anonymous function with single-level tracing\nenabled --- same as \"function f { ... }; functions -T f; f\", but without\nnaming the function.\n\n2. \"function -T foo { ... }\".  It used to define two functions, named \"-T\"\nand \"foo\" (see the MULTI_FUNC_DEF option).  It now defines a function\n\"foo\" with tracing enabled.\n\n3. \"function -- { ... }\".  It used to define a function named \"--\".  It\nnow defines and executes an anonymous function.  The \"--\" is taken to be\nan end-of-options guard (same as \"ls --\").\n\nThe sh-compatible function definition syntax, \"f() { ... }\", is unchanged.\n\nThe time-out (-t) value given to zsh/system's `zsystem flock` command is\nnow limited to 2^30-1 seconds (= a little over 34 years).\n\nzstyle: For background, recall that the zstyle builtin associates styles with\nvalues for particular contexts, and when a context (such as ':foo:bar:baz') is\nmatched by multiple patterns (such as ':foo:*' and ':foo:bar:*'), the style's\nvalue for the more specific of the patterns is used.  In zsh 5.8 and earlier\nthe determination of which pattern is \"more specific\" used semantics slightly\ndifferent to those the documentation promised.  The implementation was changed\nto match the documentation.  The upshot of this is that if you set a single\nstyle in multiple contexts, zsh 5.9 may use the values set for a pattern other\nthan the one zsh 5.8 used.  For example, if you do\n    zstyle ':foo:bar:*'   style value1\n    zstyle ':foo:*:baz:*' style value2\nand the style is looked up under a context that both patterns match (e.g.,\n:foo:bar:baz:qux), zsh 5.9 will use value2 -- which is consistent with the\ndocumentation of both 5.8 and 5.9 -- but zsh 5.8 will use value1.  If this\naffects you, make the implied colons in the first pattern explicit, as in:\n    zstyle ':foo:bar:*:*' style value1\n    zstyle ':foo:*:baz:*' style value2\nThis will use value1 in both 5.8 and 5.9.\n\nElements of the region_highlight array have gained a fourth space-separated\nfield.  Code written against 5.9 that sets the new field may break under 5.8:\nfor example, the element \"0 20 bold memo=foo\", which is valid under 5.9, would\nnot work under 5.8.  (Under the hood, 5.8 does not recognize the space as\nterminating the highlighting specification.)  On the other hand, code that does\nnot set the new, fourth field will continue to work under both 5.8 and 5.9.\n(As it happens, adding a comma after \"bold\" will make both 5.8 and 5.9 do the\nright thing, but this should be viewed as an unsupported hack.)\n\nThe XTRACE option is now disabled while running user-defined completion\nwidgets.  See NEWS.\n\nemulate sh: When zsh emulates sh, the final command in a pipeline is now run in\na subshell.  This differs from the behavior in the native (zsh) mode, but is\nconsistent with most other sh implementations.\n\nThe export and readonly builtins now ignore the -p option when there are\noperands given and POSIX_BUILTINS is enabled. This more closely matches the\nbehaviour of bash and ksh.\n\ngetopts now calculates OPTIND in a similar manner to other shells when the\nPOSIX_BUILTINS option is enabled.\n\nIgnored-signal traps are now inherited by subshells when the POSIX_TRAPS\noption is enabled.\n\nemulate sh: Inf and NaN are now treated as parameter names in arithmetic\ncontext when zsh is emulating sh.\n\nThe ${name:offset:length} expansion syntax now behaves more similarly to\nother shells in that the offset and length are applied as array indices\nprior to scalar conversion in e.g. \"${*:0:2}\".\n\nThe optimization for the =(\u003c\u003c\u003cfoo) construct with no command, which\ncreates a temporary file with contents \"foo\", now adds a newline byte\nafter \"foo\" for consistency with the behaviour of the \u003c\u003c\u003c redirection\neverywhere else.\n\nIncompatibilities between 5.7.1 and 5.8.1\n-----------------------------------------\n\nThe history expansion !:1:t2 used to be interpreted such that the 2\nwas a separate character added after the history expansion.  Now\nit is an argument to the :t modifier.\n\nFor example\n\n% echo /my/interesting/path\n% echo !:1:t2\n\nused to echo \"path2\", but now echoes \"interesting/path\".\n\nThe behaviour of :h has similarly changed.\n\nThe behaviour has also changed in forms such as ${foo:t2) and *(:t2),\nbut in those cases the previous behaviour was not meaningful.\n\nThe vcs_info function VCS_INFO_quilt-dirfind now returns a string value\nby setting $REPLY.  Previously it printed the value to standard output.\nThis only affects you if you override that function in your dotfiles.\n\nThe cd and chdir builtins no longer interpret operands like -1 and +2 as\nstack entries when POSIX_CD is enabled.\n\nDropping privileges with `unsetopt privileged` may fail (with an error\nmessage) on some older and uncommon platforms due to library dependency\nchanges made in the course of fixing CVE-2019-20044.  Please report this\nto the zsh-workers mailing list if your system is affected.  See NEWS for\nmore.\n\nPROMPT_SUBST expansion is no longer performed on arguments to prompt-\nexpansion sequences such as %F.\n\nIncompatibilities between 5.6.2 and 5.7.1\n-----------------------------------------\n\n1) vcs_info git: The gen-unapplied-string hook receives the patches in\norder (next to be applied first).  This is consistent with the hg\nbackend and with one of two contradictory claims in the documentation\n(the other one has been corrected).  In zsh through 5.6.2, the patches\nwere passed in reverse order, next to be applied being last in the\narray.\n\nThe gen-applied-string hook is unaffected; it still receives the patches in\nreverse order, from last applied to first applied.\n\n2) The option NO_UNSET now also applies when reading values from\nvariables without a preceding '$' sign in shell arithmetic expansion\nand in the double-parentheses and 'let' arithmetic commands.\n\n3) _alternative now correctly handles the same (...) action syntax as\n_arguments; this may necessitate quoting/escaping in calls to _alternative\nand _regex_arguments that wasn't previously required.  See\nhttps://zsh.org/workers/48414 (commit zsh-5.8-348-g2c000ee7b) for details\nand an example.\n\nIncompatibilities between 5.5.1 and 5.6.2\n-----------------------------------------\n\nThe completion helper _remote_files, typically used after a hostname\nwith scp-style completion, now uses remote-files instead of files as a\ntag.  This makes it easier to restrict completions with the tag-order\nstyle.\n\nIncompatibilities between 5.4.2 and 5.5.1\n-----------------------------------------\n\n1) The default build-time maximum nested function depth has been\ndecreased from 1000 to 500 based on user experience.  However,\nit can now be changed at run time via the variable FUNCNEST.\nIf you previously configured the shell to set a different value,\nor to remove the check, this is now reflected in the default\nvalue of the variable.\n\n2) The syntax\n\nfoo=([key]=value)\n\ncan be used to set elements of arrays and associative arrays.  In the\nunlikely event that you need to set an array by matching files using a\npattern that starts with a character range followed by '=', you need to\nquote the '=', e.g.:\n\nfoo=([aeiou]\\=vowel)\n\nThis is only required for array values contained within parentheses;\ncommand line expansion for normal arguments has not changed.\n\n3) The syntax\n\n[[ -o foo ]]\n\nwhere foo is not the name of a shell option (with optional underscores\nand optional \"no\" prefix) used to be treated as a syntax error, i.e.,\nthe enclosing command line or file were aborted.  It now emits a warning\nand returns a non-zero exit code.  For further details, see the\ndocumentation of the -o switch in the chapter \"Conditional Expressions\"\nin the zshmisc(1) manual.\n\n\nIncompatibilities between 5.3.1 and 5.4.2\n-----------------------------------------\n\n1) The default behaviour of code like the following has changed:\n\n  alias foo='noglob foo'\n  foo() { print function body; }\n\nWhen this is encountered in a start-up file, or other place where input\nwas read line by line, \"foo\" is in command position and is expanded as\nan alias before the function definition takes place.  In previous\nversions of the shell, this caused two functions \"noglob\" and \"foo\" to\nbe defined.  Any expansion of an alias in a function definition is\nnearly always an unintended effect, as well as hard to detect, so has\nbeen made an error.  (The option setting NO_MULTI_FUNC_DEF turned this\ncase into an error, but did not help with other cases and is off by\ndefault.)  The alternative, of not expanding the alias, was rejected as\nit was more difficult to achieve in the parser and also would silently\nchange the shell's behaviour between versions.  A new option,\nALIAS_FUNC_DEF, has been added, which can be set to make the shell\nbehave as in previous versions.  It is in any case recommended to use\nthe \"function\" keyword, as aliases are not expanded afterwards.\n\n2) It was an undocumented, and largely useless, feature that a function\nautoloaded with an absolute path was searched for along the normal fpath\n(as if the leading / was missing) and, if found, loaded under the full\nname including the leading slash.  This has been replaced with the more\nuseful feature that the function is searched for only at the given\nabsolute path; the name of the function is the base name of the file.\nNote that functions including a non-leading / behave as before,\ne.g. if `dir/name' is found anywhere under a directory in $fpath it is\nloaded as a function named `dir/name'.\n\n3) vcs_info: When neither a set-patch-format nor a gen-applied-string\n(resp. gen-unapplied-string) hook is set, vcs_info now '%'-escapes the\napplied-string (resp. unapplied-string) before interpolating it into the\npatch-format string, to prevent literal `%' signs in the interpolated\nvalue from being interpreted as prompt escape sequences.  If you use\n${vcs_info_msg_0_} in a context other than the shell prompt, you may need\nto undo the escaping with:\n\n    print -v vcs_info_msg_0_ -Pr -- \"${vcs_info_msg_0_}\"\n\nThis is also needed if $vcs_info_msg_0_ is used to set $psvar.\n\n4) functions executed by ZLE widgets no longer have their standard input\nclosed, but redirected from /dev/null instead. That still guards\nagainst user defined widgets inadvertently reading from the tty device,\nand addresses the antisocial behaviour of running a command with its\nstdin closed.\n\n5) [New between 5.4.1 and 5.4.2] In previous versions of the shell, the\nfollowing code:\n\n    () { setopt err_return; false; echo 'oh no' } \u0026\u0026 true\n\nprinted \"oh no\", as the ERR_RETURN behaviour was suppressed when\na function was executed on the left hand side of an \"\u0026\u0026\" list.  This was\nundocumented and inconvenient as it is generally more useful to consider\nexecution within a function in isolation from its environment.  The shell\nnow returns from the function on executing `false'.  (This is general\nto all functions; an anonymous function is shown here for compactness.)\n\n\nIncompatibilities between 5.0.8 and 5.3\n----------------------------------------\n\n1) In character classes delimited by \"[\" and \"]\" within patterns, whether\nused for filename generation (globbing) or other forms of pattern\nmatching, it used not to be possible to quote \"-\" when used for a range,\nor \"^\" and \"!\" when used for negating a character set.  The characters can\nnow be quoted by any of the standard shell means, but note that\nthe \"[\" and \"]\" must not be quoted.  For example,\n\n  [[ $a = ['a-z'] ]]\n\nmatches if the variable a contains just one of the characters \"a\", \"-\"\nor \"z\" only.  Previously this would have matched any lower case ASCII\nletter.  Note therefore the useful fact that\n\n  [[ $a = [\"$cset\"] ]]\n\nmatches any character contained in the variable \"cset\".  A consequence\nof this change is that variables that should have active ranges need\n(with default zsh options) to be indicated explicitly, e.g.\n\n  cset=\"a-z\"\n  [[ b = [${~cset}] ]]\n\nThe \"~\" causes the \"-\" character to be active.  In sh emulation the\n\"~\" is unnecessary in this example and double quotes must be used to\nsuppress the range behaviour of the \"-\".\n\n2) The first argument to 'repeat' is now evaluated as an arithmetic\nexpression.  It was always documented to be an arithmetic expression, but\nuntil now the decimal integer at the start of the value was used and the\nremainder of the value discarded.  This could lead to different behaviour\nif the argument contains non-numeric characters, or if the argument has\nleading zeroes and the OCTAL_ZEROES option is set.\n\n3) For some time the shell has had a POSIX_TRAPS option which determines\nwhether the EXIT trap has POSIX behaviour (the trap is only run at shell\nexit) or traditional zsh behaviour (the trap is run once and discarded\nwhen the enclosing function or shell exits, whichever happens first).\nThe use of this option has now been made \"sticky\" on the EXIT trap ---\nin other words, the setting of the option at the point where the trap is\nset now determines whether the trap has POSIX or traditional zsh\nbehaviour.  This means that changing the option after the trap was set\nno longer has any effect.\n\nOther aspects of EXIT trap handling have not changed --- there is still\nonly one EXIT trap at any point in a programme, so it is not generally\nuseful to combine POSIX and non-POSIX behaviour in the same script.\n\n4) There was an undocumented feature dating from the early days of zsh\nthat glob qualifiers consisting only of the digits 0 to 7 were treated\nas an octal file mode to \"and\" with the modes of files being tested.\nThis has been removed in order to be more sensitive to syntax errors.\nThe \"f\" qualifier has for many years been the documented way of testing\nfile modes; it allows the \"and\" test (\"*(f+1)\" is the documented\nequivalent of \"*(1)\") as well as many other forms.\n\n5) The completion helper function _arguments now escapes both backslashes\nand colons in the values of option arguments when populating the $opt_args\nassociative array.  Previously, colons were escaped with a backslash but\nbackslashes were not themselves escaped with a backslash, which lead to\nambiguity: '-x foo\\:bar' (one argument with a backslashed colon) and\n'-x foo\\\\ bar' (two arguments, and the first one ends in a backslash) would\nboth set $opt_args[-x] to the same value.  This example assumes the -x\noption's spec declared two arguments, as in:\n    _arguments : -x:foo:${action}:bar:$action\n\nFor the more common case of non-repeatable options that take a single\nargument, completion functions now have to unescape not only colons but\nalso backslashes when obtaining the option's argument from $opt_args.\n\n6) Previously, if the function command_not_found_handler was run\nin place of a command-not-found error, and the function returned\nnon-zero status, zsh set the status to 127 and printed an error message\nanyway.  Now, the status from the handler is retained and no additional\nmessage is printed.  The main reasons for this change are that it was not\npossible to return a non-zero status to the parent shell from a command\nexecuted as a replacement, and the new implementation is more consistent\nwith other shells.\n\n7) The output of \"typeset -p\" (and synonyms) now takes into account the\nfunction scope and export state of each parameter.  Exported parameters\nare output as \"export\" commands unless the parameter is also local, and\nother parameters not local to the scope are output with the \"-g\" option.\nPreviously, only \"typeset\" commands were output, never using \"-g\".\n\n8) At spelling-correction prompt ($SPROMPT), where the choices offered are\n[nyae], previously \u003cEnter\u003e would be accepted to mean [N] and \u003cSpace\u003e and\n\u003cTab\u003e would be accepted to mean [Y].  Now \u003cSpace\u003e and \u003cTab\u003e are invalid\nchoices: typing either of them remains at the prompt.\n\n9) The $ary[i,j] subscript syntax to take a slice of an array behaves\ndifferently when both i and j are larger than the number of elements in\nthe array.  When i == j, such a slice always yields an empty array, and\nwhen i \u003c j it always yields an array of one empty string element.  The\nfollowing example illustrates how this differs from past versions.\n\n     nargs() { print $# }\n     a=(one two)\n     for i in 1 2 3 4; do\n      for j in 1 2 3 4 5; do\n       print -n \"$i $j =\u003e \"\n       nargs \"${(@)a[i,j]}\"\n      done\n     done\n     \n     5.2       |  5.3 **\n     ----------+----------\n     1 1 =\u003e 1  |  1 1 =\u003e 1\n     1 2 =\u003e 2  |  1 2 =\u003e 2\n     1 3 =\u003e 2  |  1 3 =\u003e 2\n     1 4 =\u003e 2  |  1 4 =\u003e 2\n     1 5 =\u003e 2  |  1 5 =\u003e 2\n     2 1 =\u003e 0  |  2 1 =\u003e 0\n     2 2 =\u003e 1  |  2 2 =\u003e 1\n     2 3 =\u003e 1  |  2 3 =\u003e 1\n     2 4 =\u003e 1  |  2 4 =\u003e 1\n     2 5 =\u003e 1  |  2 5 =\u003e 1\n     3 1 =\u003e 0  |  3 1 =\u003e 0\n     3 2 =\u003e 0  |  3 2 =\u003e 0\n     3 3 =\u003e 0  |  3 3 =\u003e 0\n     3 4 =\u003e 0  |  3 4 =\u003e 1   **\n     3 5 =\u003e 0  |  3 5 =\u003e 1   **\n     4 1 =\u003e 0  |  4 1 =\u003e 0\n     4 2 =\u003e 0  |  4 2 =\u003e 0\n     4 3 =\u003e 0  |  4 3 =\u003e 0\n     4 4 =\u003e 1  |  4 4 =\u003e 0   **\n     4 5 =\u003e 1  |  4 5 =\u003e 1\n\nThe behaviour of the parameter flag (P) has changed when it appears\nin a nested parameter group, in order to make it more useful in\nsuch cases.  A (P) in the outermost parameter group behaves as\nbefore.  See NEWS for more.\n\nThe default behaviour when text is pasted into an X Windows terminal has\nchanged significantly (unless you are using a very old terminal emulator\nthat doesn't support this mode).  Now, the new \"bracketed paste mode\"\ntreats all the pasted text as literal characters.  This means, in\nparticular, that a newline is simply inserted as a visible newline; you\nneed to hit Return on the keyboard to execute the pasted text in one go.\nSee the description of zle_bracketed_paste in the zshparams manual for\nmore.  \"unset zle_bracketed_paste\" restores the previous behaviour.\n\nAs noted in NEWS, the builtins declare, export, float, integer, local,\nreadonly and typeset now have corresponding reserved words that provide\ntrue assignment semantics instead of an approximation by means of normal\ncommand line arguments.  It is hoped that this additional consistency\nprovides a more natural interface.  However, compatibility with older\nversions of zsh can be obtained by turning off the reserved word\ninterface, exposing the builtin interface:\n\n  disable -r declare export float integer local readonly typeset\n\nThis is also necessary in the unusual eventuality that the builtins are\nto be overridden by shell functions, since reserved words take\nprecedence over functions.\n\n10) For compatibility with other shells, the syntax\n\narray=([index]=value)\n\ncan be used with both associative arrays and normal arrays.  In the\nunlikely event that you wish to create an array with an entry\nmatching a file whose name consists of one of a range of characters\nmatched as a [...] expression, followed by an equal sign, followed\nby arbitrary other characters, it is now necessary to quote the equals\nsign.\n\nIncompatibilities between 5.0.7 and 5.0.8\n-----------------------------------------\n\nVarious arithmetic operations have changed, in particular with respect\nto the choice of integer or floating point operations.  The new\nbehaviour is intended to be more consistent, but is not compatible with\nthe old.\n\n1) Previously, the modulus operation, `%', implicitly converted the\noperation to integer and output an integer result, even if one\nor both of the arguments were floating point.  Now, the C math\nlibrary fmod() operator is used to implement the operation where\none of the arguments is floating point.  For example:\n\nOld behaviour:\n\n% print $(( 5.5 % 2 ))\n1\n\nNew behaviour:\n\n% print $(( 5.5 % 2 ))\n1.5\n\n\n2) Previously, assignments to variables assigned the correct type to\nvariables declared as floating point or integer, but this type was\nnot propagated to the value of the expression, as a C programmer\nwould naturally expect.  Now, the type of the variable is propagated\nso long as the variable is declared as a numeric type (however this\nhappened, e.g. the variable may have been implicitly typed by a\nprevious assignment).  For example:\n\nOld behaviour:\n\n% integer var\n% print $(( var = 5.5 / 2.0 ))\n2.75\n% print $var\n2\n\nNew behaviour:\n\n% integer var\n% print $(( var = 5.5 / 2.0 ))\n2\n% print $var\n2\n\n\n3) Previously, the FORCE_FLOAT option only forced the use of floating\npoint in arithmetic expressions for integer constants, i.e. numbers\ntyped directly into the expression, but not for variables.  Hence\nan operation involving only integer variables (or string variables\ncontaining integers) was not forced to be performed with floating point\narithmetic.  Now, operations involving variables are also forced to\nfloating point.  For example:\n\nOld behaviour:\n\n% unsetopt FORCE_FLOAT\n% print $(( 1 / 2 ))\n0\n% integer i=1 j=2\n% print $(( i / j ))\n0\n% setopt FORCE_FLOAT\n% print $(( 1 / 2 ))\n0.5\n% print $(( i / j ))\n0\n\nNew behaviour:\n\n% unsetopt FORCE_FLOAT\n% print $(( 1 / 2 ))\n0\n% integer i=1 j=2\n% print $(( i / j ))\n0\n% setopt FORCE_FLOAT\n% print $(( 1 / 2 ))\n0.5\n% print $(( i / j ))\n0.5\n\n\n4) The _git completion used to offer both local and remote heads under the\ntag 'heads'.  The tag has now been split into 'heads-local' and\n'heads-remote' in all contexts that existed in 5.0.7.  The --fixup/--squash\ncontext still uses the tag 'heads' (but this may change in a future release).\n\n\nIncompatibilities between 5.0.2 and 5.0.5\n-----------------------------------------\n\nThe \"zshaddhistory\" hook mechanism documented in the zshmisc manual page\nhas been upgraded so that a hook returning status 2 causes a history\nline to be saved on the internal history list but not written to the\nhistory file.  Previously any non-zero status return would cause\nthe line not to be saved on the history at all.  It is recommended\nto use status 1 for this (indeed most shell users would naturally do\nso).\n\nIncompatibilities between 5.0.0 and 5.0.2\n-----------------------------------------\n\nIn 5.0.0, the new \"sticky\" emulation feature was applied to functions\nexplicitly declared within an expression following `emulate ... -c', but\ndid not apply to functions marked for autoload in that expression.  This\nwas not documented and experience suggests it was inconvenient, so in\n5.0.2 autoloads also have the sticky property.\n\nIn other words,\n\n  emulate zsh -c 'func() { ... }'\n\nbehaves the same way in 5.0.0 and 5.0.2, with the function func always being\nrun in native zsh emulation regardless of the current option settings.\nHowever,\n\n  emulate zsh -c 'autoload -Uz func'\n\nbehaves differently: in 5.0.0, func was loaded with the options in\neffect at the point where it was first run, and subsequently run with\nwhatever options were in effect at that point; in 5.0.2, func is loaded\nwith native zsh emulation options and run with those same options.  This\nis now the recommended way of ensuring a function is loaded and run with\na consistent set of options.\n\nNote that the command `autoload -z' has never affected the options\napplied when the function is loaded or run, only the effect of the\nKSH_AUTOLOAD option at the point the function is loaded.\n\nPossible incompatibilities between 4.2 and 5.0\n----------------------------------------------\n\nHere are some incompatibilities in the shell since the 4.2 series of\nreleases.  It is hoped most users will not be adversely affected by these.\n\nIn previous releases of the shell, builtin commands and precommand\nmodifiers that did not accept options also did not recognize the\nargument \"--\" as marking the end of option processing without being\nconsidered an argument.  This was not documented and was incompatible\nwith other shells.  All such commands now handle this syntax.\n\nThe configuration option --enable-lfs to enable large file support has\nbeen replaced by autoconf's standard --enable-largefile mechanism.\nAs this is usually used whenever necessary, this won't usually\nbe noticeable; however, anyone configuring with --disable-lfs\nshould configure with --disable-largefile instead.\n\nThe configuration option --with-curses-terminfo has been replaced\nby the option --with-term-lib=\"LIBS\" where LIBS is a space-separated\nlist of libraries to search for termcap and curses features.\n\nThe option SH_WORD_SPLIT, used in Bourne/Korn/Posix shell compatibility\nmode, has been made more like other shells in the case of substitutions of\nthe form ${1+\"$@\"} (a common trick used to work around problems in older\nBourne shells) or any of the related forms with the + replaced by - or =\nwith an optional colon preceding.  Previously, with SH_WORD_SPLIT in\neffect, this expression would cause splitting on all white space in the\nshell arguments.  (This was always regarded as a bug but was long-standing\nbehaviour.)  Now it is treated identically to \"$@\".  The same change\napplies to expressions with forced splitting such as ${=1+\"$@\"}, but\notherwise the case where SH_WORD_SPLIT is not set is unaffected.\n\nDebug traps (`trap ... DEBUG' or the function TRAPDEBUG) now run by default\nbefore the command to which they refer instead of after.  This is almost\nalways the right behaviour for the intended purpose of debugging and is\nconsistent with recent versions of other shells.  The option\nDEBUG_BEFORE_CMD can be unset to revert to the previous behaviour.\n\nPreviously, process substitutions of the form =(...), \u003c(...) and \u003e(...)\nwere only handled if they appeared as separate command arguments.\n(However, the latter two forms caused the current argument to be\nterminated and a new one started even if they occurred in the middle of\na string.)  Now all three may be followed by other strings, and the\nlatter two may also be preceded by other strings.  Remaining\nlimitations on their use (to reduce incompatibilities to a minimum)\nare documented in the zshexpn.1 manual.\n\nIn previous versions of the shell it was possible to use index 0 in an\narray or string subscript to refer to the same element as index 1 if the\noption KSH_ARRAYS was not in effect.  This was a limited approximation to\nthe full KSH_ARRAYS handling and so was not very useful.  In this version\nof the shell, this behaviour is only provided when the option\nKSH_ZERO_SUBSCRIPT is set.  Note that despite the name this does not provide\ntrue compatibility with ksh or other shells and KSH_ARRAYS should still be\nused for that purpose.  By default, the option is not set; an array\nsubscript that evaluates to 0 returns an empty string or array element and\nattempts to write to an array or string range including only a zero\nsubscript are treated as an error.  Writes to otherwise valid ranges that\nalso include index zero are allowed; hence for example the assignment\n  array[(R)notfound,(r)notfound]=()\n(where the string \"notfound\" does not match an element in $array) sets the\nentire array to be empty, as in previous versions of the shell.\nKSH_ZERO_SUBSCRIPT is irrelevant when KSH_ARRAYS is set.  Also as in previous\nversions, attempts to write to non-existent elements at the end of an array\ncause the array to be suitably extended.  This difference means that, for\nexample\n  array[(R)notfound]=(replacement)\nis an error if KSH_ZERO_SUBSCRIPT is not set (new behaviour), while\n  array[(r)notfound]=(replacement)\ncauses the given value to be appended to the array (same behaviour as\nprevious versions).\n\nThe \"exec\" precommand modifier now takes various options for compatibility\nwith other shells.  This means that whereas \"exec -prog\" previously\ntried to execute a command name \"-prog\", it will now report an error\nin option handling.  \"exec -- -prog\" will execute \"-prog\".  If\nthe option EQUALS is set, as it is by default in zsh's native mode,\n\"exec =-prog\" behaves the same way in all versions of zsh provided\nthe command can be found.\n\nThe \"unset\" builtin now does not regard the unsetting of non-existent\nvariables as an error, so can still return status 0 (depending on the\nhandling of other arguments).  This appears to be the standard shell\nbehaviour.\n\nThe variable BAUD is no longer set automatically by the shell.\nIn previous versions it was set to the baud rate reported by\nthe terminal driver in order to initialise the line editor's\ncompensation mechanism for slow baud rates.  However, the baud\nrate so reported is very rarely related to the limiting speed of\nscreen updates on modern systems.  Users who need the compensation\nmechanism should set BAUD to an appropriate rate by hand.\n\nThe variable HOME is no longer set by the shell if zsh is emulating any\nother shell at startup; it must be present in the environment or set\nsubsequently by the user.  It is valid for the variable to be unset.\n\nIf the shell starts in a mode where it is emulating another shell\n(typically because the base name of the shell was \"sh\" or another known\nshell), the \"repeat\" syntax is not available by default, to avoid clashes\nwith external commands, but the \"ulimit\" command is available by default.\n\"limit\", \"sched\" and \"unlimit\" are not available by default in such modes:\nthis has been the case for many versions but is now documented for the\nfirst time.  (Users should note that emulation modes are not designed for\nbackwards compatibility with previous versions of zsh, but to maximise\ncompatibility with other shells, hence it is not safe to assume emulation\nmodes will behave consistently between zsh versions.)\n\nParameter substitutions in the form ${param//#%search/replace} match\nagainst \"search\" anchored at both ends of the parameter value.  Previously\nthis syntax would have matched against \"%search\", anchored only at the head\nof the value.  The form ${param//#$search/replace} where the value\n$search starts with \"%\" considers the \"%\" to be part of the search\nstring as before.\n\nConfigure attempts to decide if multibyte characters are supported by the\nsystem and if so sets the effect of --enable-multibyte, unless\n--disable-multibyte was passed on the command line.  When\n--enable-multibyte is in effect, the MULTIBYTE shell option is on by\ndefault; this causes many operations to recognise characters in the current\nlocale.  (Most typically this is used for a UTF-8 character set but the\nshell will work with any character set provided by the system where\nindividual octets are either US ASCII characters or have the top bit set.)\nOlder versions of the shell always assumed a character was one byte; this\nremains the case if --disable-multibyte is in effect or if the MULTIBYTE\noption is unset.  In some places the width of characters will be taken into\naccount where previously a raw string length was used; this is transparent\nin calculations of screen position, but also occurs, for example, in\ncalculations of padding width.  Note that MULTIBYTE is not automatically\nset when emulating Bourne- and POSIX-style shells; for interactive use of\nthese emulations it may be necessary to set it by hand.  Note also that the\noption COMBINING_CHARS is not set by default due to difficulties detecting\nthe ability of the terminal to display combining characters correctly; MAC\nusers in particular will probably wish to set this option.\n\nZsh has previously been lax about whether it allows octets with the\ntop bit set to be part of a shell identifier.  Older versions of the shell\nassumed all such octets were allowed in identifiers, however the POSIX\nstandard does not allow such characters in identifiers.  The older\nbehaviour is still obtained with --disable-multibyte in effect.\nWith --enable-multibyte in effect (see previous paragraph) there are three\npossible cases:\n  MULTIBYTE option unset:  only ASCII characters are allowed; the\n    shell does not attempt to identify non-ASCII characters at all.\n  MULTIBYTE option set, POSIX_IDENTIFIERS option unset: in addition\n    to the POSIX characters, any alphanumeric characters in the\n    local character set are allowed.  Note that scripts and functions that\n    take advantage of this are non-portable; however, this is in the spirit\n    of previous versions of the shell.  Note also that the options must\n    be set before the shell parses the script or function; setting\n    them during execution is not sufficient.\n  MULITBYTE option set, POSIX_IDENTIFIERS set:  only ASCII characters\n    are allowed in identifiers even though the shell will recognise\n    alphanumeric multibyte characters.\n\nThe sched builtin now keeps entries in time order.  This means that\nafter adding an entry the index of an existing entry used for deletion\nmay change, if that entry had a later time than the new entry.  However,\ndeleting a entry with a later time will now never change the index of an\nentry with an earlier time, which could happen with the previous method.\n\nThe completion style pine-directory must now be set to use completion\nfor PINE mailbox folders; previously it had the default ~/mail.  This\nchange was necessary because otherwise recursive directories under\n~/mail were searched by default, which could be a considerable unnecessary\nhit for anyone not using PINE.  The previous default can be restored with:\n  zstyle ':completion:*' pine-directory ~/mail\n\nThe completion style fake-files now allows patterns as directories,\nfor example the value '/home/*:.snapshot' is now valid.  This will\nonly cause problems in the unlikely event that a directory in the style\nhas a pattern character in it.\n\nThe default maximum function depth (configurable with\n--enable-max-function-depth) has been decreased to 1000 from 4096.  The\nprevious value was observed to be small enough that crashes still occurred\non some fairly common PC configurations.  This change is only likely to\naffect some highly specialised uses of the shell.\n\nThe variables HISTCHARS and histchars now reject any attempt to\nset non-ASCII characters for history or comments.  Multibyte characters\nhave never worked and the most consistent change was to restrict the\nset to portable characters only.\n\nWriters of add-on modules should note that the API has changed\nsignificantly to allow user control of individual features provided by\nmodules.  See the documentation for zmodload -F and\nEtc/zsh-development-guide, in that order.\n\nDocumentation\n-------------\n\nThere are a number of documents about zsh in this distribution:\n\nDoc/Zsh/*.yo\tThe master source for the zsh documentation is written in\n\t\tyodl.  Yodl is a document language written by Karel Kubat.\n\t\tIt is not required by zsh but it is a nice program so you\n\t\tmight want to get it anyway, especially if you are a zsh\n\t\tdeveloper.  It can be downloaded from\n\t\thttps://fbb-git.github.io/yodl/\n\nDoc/zsh*.1\tMan pages in nroff format.  These will be installed\n\t\tby \"make install.man\" or \"make install\".  By default,\n\t\tthese will be installed in /usr/local/man/man1, although\n\t\tyou can change this with the --mandir option to configure\n\t\tor editing the user configuration section of the top level\n\t\tMakefile.\n\nDoc/zsh.texi\tEverything the man pages have, but in texinfo format.  These\n\t\twill be installed by \"make install.info\" or \"make install\".\n\t\tBy default, these will be installed in /usr/local/info,\n\t\talthough you can change this with the --infodir option to\n\t\tconfigure or editing the user configuration section of the\n\t\ttop level Makefile.  Version 4.0 or above of the\n\t\tTexinfo tools are recommended for processing this file.\n\nAlso included in the distribution are:\n\nDoc/intro.ms\tAn introduction to zsh in troff format using the ms\n\t\tmacros.  This document explains many of the features\n\t\tthat make zsh more equal than other shells.\n\t\tUnfortunately this is based on zsh-2.5 so some examples\n\t\tmay not work without changes but it is still a good\n\t\tintroduction.\n\nFor more information, see the website, as described in the META-FAQ.\n\nIf you do not have the necessary tools to process these documents, PDF,\nInfo and DVI versions are available in the separate file zsh-doc.tar.gz at\nthe archive sites listed in the META-FAQ.\n\nThe distribution also contains a Perl script in Utils/helpfiles which\ncan be used to extract the descriptions of builtin commands from the\nzshbuiltins manual page.  See the comments at the beginning of the\nscript about its usage.  The files created by this script can be used\nby example function run-help located in the subdirectory Functions/Misc to\nshow information about zsh builtins and run `man' on external commands.\nFor this the shell variable HELPDIR should point to a directory containing\nthe files generated by the helpfiles script.  run-help should be\nunaliased before loading the run-help function.  After that this function\nwill be executed by the run-help ZLE function which is by default bound\nto ESC-h in emacs mode.\n\nExamples\n--------\n\nExamples of zsh startup files are located in the subdirectory\nStartupFiles.  Examples of zsh functions and scripts are located in\nthe subdirectory Functions.  Examples of completion control commands\n(compctl) are located in the file Misc/compctl-examples.\n\nZsh FTP Sites, Web Pages, and Mailing Lists\n-------------------------------------------\n\nThe current list of zsh FTP sites, web pages, and mailing lists can be\nfound in the META-FAQ.  A copy is included in this distribution and is\navailable separately at any of the zsh FTP sites.\n\nCommon Problems and Frequently Asked Questions\n----------------------------------------------\n\nZsh has a list of Frequently Asked Questions (FAQ) maintained by Peter\nStephenson \u003cpws@zsh.org\u003e.  It covers many common problems encountered\nwhen building, installing, and using zsh.  A copy is included in this\ndistribution in Etc/FAQ and is available separately at any of the zsh\nftp sites.\n\nZsh Maintenance and Bug Reports\n-------------------------------\n\nZsh is currently maintained by the members of the zsh-workers mailing list\nand coordinated by Peter Stephenson \u003ccoordinator@zsh.org\u003e.  Please send\nany feedback and bugs reports to \u003czsh-workers@zsh.org\u003e.\n\nReports are most helpful if you can reproduce the bug starting zsh with\nthe -f option.  This skips the execution of local startup files except\n/etc/zshenv.  If a bug occurs only when some options set try to locate\nthe option which triggers the bug.\n\nThere is a script \"reporter\" in the subdirectory Util which will print out\nyour current shell environment/setup.  If you cannot reproduce the bug\nwith \"zsh -f\", use this script and include the output from sourcing this\nfile.  This way, the problem you are reporting can be recreated.\n\nThe known bugs in zsh are listed in the file Etc/BUGS.  Check this as\nwell as the Frequently Asked Questions (FAQ) list before sending a bug\nreport.  Note that zsh has some features which are not compatible with\nsh but these are not bugs.  Most of these incompatibilities go away\nwhen zsh is invoked as sh or ksh (e.g. using a symbolic link).\n\nIf you send a bug report to the list and are not a subscriber, please\nmention this in your message if you want a response.\n\nIf you would like to contribute to the development and maintenance of zsh,\nthen you should join the zsh-workers mailing list (check the META-FAQ\nfor info on this).  You should also read the \"zsh-development-guide\"\nlocated in the subdirectory Etc.\n\nContributors\n------------\n\nThe people who have contributed to this software project are listed\nin Etc/CONTRIBUTORS.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzsh-users%2Fzsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzsh-users%2Fzsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzsh-users%2Fzsh/lists"}