AUTO_CD (-J)
If a command is issued that cant be executed as a normal command, and the command is the name of a directory, perform the
cd command to that directory. This option is only applicable if the option SHIN_STDIN is set, i.e. if commands are being
read from standard input. The option is designed for interactive use; it is recommended that cd be used explicitly in
scripts to avoid ambiguity.
| AUTO_PUSHD (-N)
Make cd push the old directory onto the directory stack.
| CDABLE_VARS (-T)
If the argument to a cd command (or an implied cd with the AUTO_CD option set) is not a directory, and does not begin with a
slash, try to expand the expression as if it were preceded by a ~ (see the section Filename Expansion).
| CD_SILENT
Never print the working directory after a cd (whether explicit or implied with the AUTO_CD option set). cd normally prints
the working directory when the argument given to it was -, a stack entry, or the name of a directory found under CDPATH.
Note that this is distinct from pushds stack-printing behaviour, which is controlled by PUSHD_SILENT. This option overrides
the printing-related effects of POSIX_CD.
| CHASE_DOTS
Changing to a directory containing '..' treated as canceling the previous segment
(in other words, foo/.. would be removed from the path, or
if .. is the first part of the path, the last part of the current working directory would be removed),
instead resolve the path to the physical directory. Overridden with CHASE_LINKS.
For example, with /my/sheet being a link to /alt/rod.
When set, cd /my/sheet changes to /alt.
The same applies if the current directory is /my/sheet and cd .. is used.
Without this option set, cd /my/sheet/.. changes to /my.
Other symbolic links in the path will also be resolved.
| CHASE_LINKS (-w)
Resolve symbolic links to their actual values when changing directory.
With CHASE_DOTS ..
will be treated as referring to the actual parent, even if the preceding path segment is a symbolic link.
| POSIX_CD K S
If the option is set cd, chdir and pushd
does not test for directories beneath the local directory (.) until after all directories in
cdpath have been
tested, and the cd and chdir commands do not recognise arguments of the form {+|-}n as directory stack entries.
outputting the new directory after changing to it
is no longer restricted to interactive shells (outputing the directory stack with
pushd is
); and any use of a component of $CDPATH, including a . but excluding an empty component that is
otherwise treated as ., causes the directory to be printed.
with the option unset is described in the documentation for the cd builtin in zshbuiltins(1).
| PUSHD_IGNORE_DUPS
Dont push multiple copies of the same directory onto the directory stack.
| PUSHD_MINUS
Exchanges the meanings of + and - when used with a number to specify a directory in the stack.
| PUSHD_SILENT (-E)
Do not print the directory stack after pushd or popd.
| PUSHD_TO_HOME (-D)
Have pushd with no arguments act like pushd $HOME.
| | Completion |
| ALWAYS_LAST_PROMPT D
If unset, key functions that list completions try to return to the last prompt if given a numeric argument. If set these
functions try to return to the last prompt if given no numeric argument.
| ALWAYS_TO_END
If a completion is performed with the cursor within a word, and a full completion is inserted, the cursor is moved to the
end of the word. That is, the cursor is moved to the end of the word if either a single match is inserted or menu
completion is performed.
| AUTO_LIST (-9) D
Automatically list choices on an ambiguous completion.
| AUTO_MENU D
Automatically use menu completion after the second consecutive request for completion, for example by pressing the tab key
repeatedly. This option is overridden by MENU_COMPLETE.
| AUTO_NAME_DIRS
Any parameter that is set to the absolute name of a directory immediately becomes a name for that directory, that will be
used by the %~ and related prompt sequences, and will be available when completion is performed on a word starting with
~. (Otherwise, the parameter must be used in the form ~param first.)
| AUTO_PARAM_KEYS D
If a parameter name was completed and a following character (normally a space) automatically inserted, and the next
character typed is one of those that have to come directly after the name (like }, :, etc.), the automatically added
character is deleted, so that the character typed comes immediately after the parameter name. Completion in a brace
expansion is affected similarly: the added character is a ,, which will be removed if } is typed next.
| AUTO_PARAM_SLASH D
If a parameter is completed whose content is the name of a directory, then add a trailing slash instead of a space.
| AUTO_REMOVE_SLASH D
When the last character resulting from a completion is a slash and the next character typed is a word delimiter, a slash, or
a character that ends a command (such as a semicolon or an ampersand), remove the slash.
| BASH_AUTO_LIST
On an ambiguous completion, automatically list choices when the completion function is called twice in succession. This
takes precedence over AUTO_LIST. The setting of LIST_AMBIGUOUS is respected. If AUTO_MENU is set, the menu behaviour will
then start with the third press. Note that this will not work with MENU_COMPLETE, since repeated completion calls
immediately cycle through the list in that case.
| COMPLETE_ALIASES
Prevents aliases on the command line from being internally substituted before completion is attempted. The effect is to
make the alias a distinct command for completion purposes.
| COMPLETE_IN_WORD
If unset, the cursor is set to the end of the word if completion is started. Otherwise it stays there and completion is done
from both ends.
| GLOB_COMPLETE
When the current word has a glob pattern, do not insert all the words resulting from the expansion but generate matches as
for completion and cycle through them like MENU_COMPLETE. The matches are generated as if a * was added to the end of the
word, or inserted at the cursor when COMPLETE_IN_WORD is set. This actually uses pattern matching, not globbing, so it
works not only for files but for any completion, such as options, user names, etc.
Note that when the pattern matcher is used, matching control (for example, case-insensitive or anchored matching) cannot be
used. This limitation only applies when the current word contains a pattern; simply turning on the GLOB_COMPLETE option
does not have this effect.
| HASH_LIST_ALL D
Whenever a command completion or spelling correction is attempted, make sure the entire command path is hashed first. This
makes the first completion slower but avoids false reports of spelling errors.
| LIST_AMBIGUOUS D
This option works when AUTO_LIST or BASH_AUTO_LIST is also set. If there is an unambiguous prefix to insert on the command
line, that is done without a completion list being displayed; in other words, auto-listing behaviour only takes place when
nothing would be inserted. In the case of BASH_AUTO_LIST, this means that the list will be delayed to the third call of the
function.
| LIST_BEEP D
Beep on an ambiguous completion. More accurately, this forces the completion widgets to return status 1 on an ambiguous
completion, which causes the shell to beep if the option BEEP is also set; this may be modified if completion is called from
a user-defined widget.
| LIST_PACKED
Try to make the completion list smaller (occupying less lines) by printing the matches in columns with different widths.
| LIST_ROWS_FIRST
Lay out the matches in completion lists sorted horizontally, that is, the second match is to the right of the first one, not
under it as usual.
| LIST_TYPES (-X) D
When listing files that are possible completions, show the type of each file with a trailing identifying mark.
| MENU_COMPLETE (-Y)
On an ambiguous completion, instead of listing possibilities or beeping, insert the first match immediately. Then when
completion is requested again, remove the first match and insert the second match, etc. When there are no more matches, go
back to the first one again. reverse-menu-complete may be used to loop through the list in the other direction. This option
overrides AUTO_MENU.
| REC_EXACT (-S)
If the string on the command line exactly matches one of the possible completions, it is accepted, even if there is another
completion (i.e. that string with something else added) that also matches.
| | Expansion and Globbing |
| BAD_PATTERN (+2) C Z
If a pattern for filename generation is badly formed, print an error message. (If this option is unset, the pattern will be
left unchanged.)
| BARE_GLOB_QUAL Z
In a glob pattern, treat a trailing set of parentheses as a qualifier list, if it contains no |, ( or (if special) ~
characters. See the section Filename Generation.
| BRACE_CCL
Expand expressions in braces which would not otherwise undergo brace expansion to a lexically ordered list of all the
characters. See the section Brace Expansion.
| CASE_GLOB D
Make globbing (filename generation) sensitive to case. Note that other uses of patterns are always sensitive to case. If
the option is unset, the presence of any character which is special to filename generation will cause case-insensitive
matching. For example, cvs(/) can match the directory CVS owing to the presence of the globbing flag (unless the option
BARE_GLOB_QUAL is unset).
| CASE_MATCH D
Make regular expressions using the zsh/regex module (including matches with =~) sensitive to case.
| CSH_NULL_GLOB C
If a pattern for filename generation has no matches, delete the pattern from the argument list; do not report an error
unless all the patterns in a command have no matches. Overrides NOMATCH.
| EQUALS Z
Perform = filename expansion. (See the section Filename Expansion.)
| EXTENDED_GLOB
Treat the #, ~ and ^ characters as part of patterns for filename generation, etc. (An initial unquoted ~ always
produces named directory expansion.)
| FORCE_FLOAT
Constants in arithmetic evaluation will be treated as floating point even without the use of a decimal point; the values of
integer variables will be converted to floating point when used in arithmetic expressions. Integers in any base will be
converted.
| GLOB (+F, ksh: +f) D
Perform filename generation (globbing). (See the section Filename Generation.)
| GLOB_ASSIGN C
If this option is set, filename generation (globbing) is performed on the right hand side of scalar parameter assignments of
the form name=pattern (e.g. foo=*). If the result has more than one word the parameter will become an array with those
words as arguments. This option is provided for backwards compatibility only: globbing is always performed on the right hand
side of array assignments of the form name=(value) (e.g. foo=(*)) and this form is recommended for clarity; with this
option set, it is not possible to predict whether the result will be an array or a scalar.
GLOB_DOTS (-4)
Do not require a leading . in a filename to be matched explicitly.
| GLOB_STAR_SHORT
When this option is set and the default zsh-style globbing is in effect, the pattern **/* can be abbreviated to ** and
the pattern ***/* can be abbreviated to ***. Hence **.c finds a file ending in .c in any subdirectory, and ***.c does
the same while also following symbolic links. A / immediately after the ** or *** forces the pattern to be treated as
the unabbreviated form.
| GLOB_SUBST C K S
Treat any characters resulting from parameter expansion as being eligible for filename expansion and filename generation,
and any characters resulting from command substitution as being eligible for filename generation. Braces (and commas in
between) do not become eligible for expansion.
| HIST_SUBST_PATTERN
Substitutions using the :s and :& history modifiers are performed with pattern matching instead of string matching. This
occurs wherever history modifiers are valid, including glob qualifiers and parameters. See the section Modifiers in
zshexpn(1).
| IGNORE_BRACES (-I) S
Do not perform brace expansion. For historical reasons this also includes the effect of the IGNORE_CLOSE_BRACES option.
| IGNORE_CLOSE_BRACES
When neither this option nor IGNORE_BRACES is set, a sole close brace character } is syntactically significant at any
point on a command line. This has the effect that no semicolon or newline is necessary before the brace terminating a
function or current shell construct. When either option is set, a closing brace is syntactically significant only in
command position. Unlike IGNORE_BRACES, this option does not disable brace expansion.
For example, with both options unset a function may be defined in the following fashion:
args() { echo $# }
while if either option is set, this does not work and something equivalent to the following is required:
args() { echo $#; }
| KSH_GLOB K
In pattern matching, the interpretation of parentheses is affected by a preceding @, *, +, ? or !. See the
section Filename Generation.
| MAGIC_EQUAL_SUBST
All unquoted arguments of the form anything=expression appearing after the command name have filename expansion (that is,
where expression has a leading ~ or =) performed on expression as if it were a parameter assignment. The argument is
not otherwise treated specially; it is passed to the command as a single argument, and not used as an actual parameter
assignment. For example, in echo foo=~/bar:~/rod, both occurrences of ~ would be replaced. Note that this happens anyway
with typeset and similar statements.
This option respects the setting of the KSH_TYPESET option. In other words, if both options are in effect, arguments
looking like assignments will not undergo word splitting.
| MARK_DIRS (-8, ksh: -X)
Append a trailing / to all directory names resulting from filename generation (globbing).
| MULTIBYTE D
Respect multibyte characters when found in strings. When this option is set, strings are examined using the system library
to determine how many bytes form a character, depending on the current locale. This affects the way characters are counted
in pattern matching, parameter values and various delimiters.
The option is on by default if the shell was compiled with MULTIBYTE_SUPPORT; otherwise it is off by default and has no
effect if turned on.
If the option is off a single byte is always treated as a single character. This setting is designed purely for examining
strings known to contain raw bytes or other values that may not be characters in the current locale. It is not necessary to
unset the option merely because the character set for the current locale does not contain multibyte characters.
The option does not affect the shells editor, which always uses the locale to determine multibyte characters. This is
because the character set displayed by the terminal emulator is independent of shell settings.
| NOMATCH (+3) C Z
If a pattern for filename generation has no matches, print an error, instead of leaving it unchanged in the argument list.
This also applies to file expansion of an initial ~ or =.
| NULL_GLOB (-G)
If a pattern for filename generation has no matches, delete the pattern from the argument list instead of reporting an
error. Overrides NOMATCH.
| NUMERIC_GLOB_SORT
If numeric filenames are matched by a filename generation pattern, sort the filenames numerically rather than
lexicographically.
| RC_EXPAND_PARAM (-P)
Array expansions of the form foo${xx}bar, where the parameter xx is set to (a b c), are substituted with fooabar foobbar
foocbar instead of the default fooa b cbar. Note that an empty array will therefore cause all arguments to be removed.
| REMATCH_PCRE
If set, regular expression matching with the =~ operator will use Perl-Compatible Regular Expressions from the PCRE library.
(The zsh/pcre module must be available.) If not set, regular expressions will use the extended regexp syntax provided by the
system libraries.
| SH_GLOB K S
Disables the special meaning of (, |, ) and < for globbing the result of parameter and command substitutions, and in
some other places where the shell accepts patterns. If SH_GLOB is set but KSH_GLOB is not, the shell allows the
interpretation of subshell expressions enclosed in parentheses in some cases where there is no space before the opening
parenthesis, e.g. !(true) is interpreted as if there were a space after the !. This option is set by default if zsh is
invoked as sh or ksh.
| UNSET (+u, ksh: +u) K S Z
Treat unset parameters as if they were empty when substituting, and as if they were zero when reading their values in
arithmetic expansion and arithmetic commands. Otherwise they are treated as an error.
| WARN_CREATE_GLOBAL
Print a warning message when a global parameter is created in a function by an assignment or in math context. This often
indicates that a parameter has not been declared local when it should have been. Parameters explicitly declared global from
within a function using typeset -g do not cause a warning. Note that there is no warning when a local parameter is assigned
to in a nested function, which may also indicate an error.
| WARN_NESTED_VAR
Print a warning message when an existing parameter from an enclosing function scope, or global, is set in a function by an
assignment or in math context. Assignment to shell special parameters does not cause a warning. This is the companion to
WARN_CREATE_GLOBAL as in this case the warning is only printed when a parameter is not created. Where possible, use of
typeset -g to set the parameter suppresses the error, but note that this needs to be used every time the parameter is set.
To restrict the effect of this option to a single function scope, use functions -W.
For example, the following code produces a warning for the assignment inside the function nested as that overrides the value
within toplevel
toplevel() {
local foo="in fn"
nested
}
nested() {
foo="in nested"
}
setopt warn_nested_var
toplevel
History
| APPEND_HISTORY D
If this is set, zsh sessions will append their history list to the history file, rather than replace it. Thus, multiple
parallel zsh sessions will all have the new entries from their history lists added to the history file, in the order that
they exit. The file will still be periodically re-written to trim it when the number of lines grows 20% beyond the value
specified by $SAVEHIST (see also the HIST_SAVE_BY_COPY option).
| BANG_HIST (+K) C Z
Perform textual history expansion, csh-style, treating the character ! specially.
| EXTENDED_HISTORY C
Save each commands beginning timestamp (in seconds since the epoch) and the duration (in seconds) to the history file. The
format of this prefixed data is:
: :;.
| HIST_ALLOW_CLOBBER
Add | to output redirections in the history. This allows history references to clobber files even when CLOBBER is unset.
| HIST_BEEP D
Beep in ZLE when a widget attempts to access a history entry which isnt there.
| HIST_EXPIRE_DUPS_FIRST
If the internal history needs to be trimmed to add the current command line, setting this option will cause the oldest
history event that has a duplicate to be lost before losing a unique event from the list. You should be sure to set the
value of HISTSIZE to a larger number than SAVEHIST in order to give you some room for the duplicated events, otherwise this
option will behave just like HIST_IGNORE_ALL_DUPS once the history fills up with unique events.
| HIST_FCNTL_LOCK
When writing out the history file, by default zsh uses ad-hoc file locking to avoid known problems with locking on some
operating systems. With this option locking is done by means of the systems fcntl call, where this method is available.
On recent operating systems this may provide better performance, in particular avoiding history corruption when files are
stored on NFS.
| HIST_FIND_NO_DUPS
When searching for history entries in the line editor, do not display duplicates of a line previously found, even if the
duplicates are not contiguous.
| HIST_IGNORE_ALL_DUPS
If a new command line being added to the history list duplicates an older one, the older command is removed from the list
(even if it is not the previous event).
| HIST_IGNORE_DUPS (-h)
Do not enter command lines into the history list if they are duplicates of the previous event.
| HIST_IGNORE_SPACE (-g)
Remove command lines from the history list when the first character on the line is a space, or when one of the expanded
aliases contains a leading space. Only normal aliases (not global or suffix aliases) have this behaviour. Note that the
command lingers in the internal history until the next command is entered before it vanishes, allowing you to briefly reuse
or edit the line. If you want to make it vanish right away without entering another command, type a space and press return.
| HIST_LEX_WORDS
By default, shell history that is read in from files is split into words on all white space. This means that arguments with
quoted whitespace are not correctly handled, with the consequence that references to words in history lines that have been
read from a file may be inaccurate. When this option is set, words read in from a history file are divided up in a similar
fashion to normal shell command line handling. Although this produces more accurately delimited words, if the size of the
history file is large this can be slow. Trial and error is necessary to decide.
| HIST_NO_FUNCTIONS
Remove function definitions from the history list. Note that the function lingers in the internal history until the next
command is entered before it vanishes, allowing you to briefly reuse or edit the definition.
| HIST_NO_STORE
Remove the history (fc -l) command from the history list when invoked. Note that the command lingers in the internal
history until the next command is entered before it vanishes, allowing you to briefly reuse or edit the line.
| HIST_REDUCE_BLANKS
Remove superfluous blanks from each command line being added to the history list.
| HIST_SAVE_BY_COPY D
When the history file is re-written, we normally write out a copy of the file named $HISTFILE.new and then rename it over
the old one. However, if this option is unset, we instead truncate the old history file and write out the new version
in-place. If one of the history-appending options is enabled, this option only has an effect when the enlarged history file
needs to be re-written to trim it down to size. Disable this only if you have special needs, as doing so makes it possible
to lose history entries if zsh gets interrupted during the save.
When writing out a copy of the history file, zsh preserves the old files permissions and group information, but will refuse
to write out a new file if it would change the history files owner.
| HIST_SAVE_NO_DUPS
When writing out the history file, older commands that duplicate newer ones are omitted.
| HIST_VERIFY
Whenever the user enters a line with history expansion, dont execute the line directly; instead, perform history expansion
and reload the line into the editing buffer.
| INC_APPEND_HISTORY
This option works like APPEND_HISTORY except that new history lines are added to the $HISTFILE incrementally (as soon as
they are entered), rather than waiting until the shell exits. The file will still be periodically re-written to trim it
when the number of lines grows 20% beyond the value specified by $SAVEHIST (see also the HIST_SAVE_BY_COPY option).
| INC_APPEND_HISTORY_TIME
This option is a variant of INC_APPEND_HISTORY in which, where possible, the history entry is written out to the file after
the command is finished, so that the time taken by the command is recorded correctly in the history file in EXTENDED_HISTORY
format. This means that the history entry will not be available immediately from other instances of the shell that are
using the same history file.
This option is only useful if INC_APPEND_HISTORY and SHARE_HISTORY are turned off. The three options should be considered
mutually exclusive.
| SHARE_HISTORY K
This option both imports new commands from the history file, and also causes your typed commands to be appended to the
history file (the latter is like specifying INC_APPEND_HISTORY, which should be turned off if this option is in effect).
The history lines are also output with timestamps ala EXTENDED_HISTORY (which makes it easier to find the spot where we left
off reading the file after it gets re-written).
By default, history movement commands visit the imported lines as well as the local lines, but you can toggle this on and
off with the set-local-history zle binding. It is also possible to create a zle widget that will make some commands ignore
imported commands, and some include them.
If you find that you want more control over when commands get imported, you may wish to turn SHARE_HISTORY off,
INC_APPEND_HISTORY or INC_APPEND_HISTORY_TIME (see above) on, and then manually import commands whenever you need them using
fc -RI.
| Initialisation|
| ALL_EXPORT (-a, ksh: -a) | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |