Options are primarily referred to by name.
These names are case insensitive and underscores are ignored.
For example, `allexport
' is equivalent to `A__lleXP_ort
'.
The sense of an option name may be inverted by preceding it with
`no
', so `setopt No_Beep
' is equivalent to `unsetopt beep
'.
This inversion can only be done once, so `nonobeep
' is not
a synonym for `beep
'. Similarly, `tify
' is not a synonym for
`nonotify
' (the inversion of `notify
').
Some options also have one or more single letter names.
There are two sets of single letter options: one used by default,
and another used to emulate sh/ksh (used when the
SH_OPTION_LETTERS
option is set).
The single letter options can be used on the shell command line,
or with the set
, setopt
and unsetopt
builtins, as normal Unix options preceded by `-
'.
The sense of the single letter options may be inverted by using
`+
' instead of `-
'.
Some of the single letter option names refer to an option being off,
in which case the inversion of that name refers to the option being on.
For example, `+n
' is the short name of `exec
', and
`-n
' is the short name of its inversion, `noexec
'.
ALL_EXPORT
(-a
, ksh: -a
)
ALWAYS_LAST_PROMPT
ALWAYS_TO_END
APPEND_HISTORY
AUTO_CD
(-J
)
cd
command to that directory.
AUTO_LIST
(-9
)
AUTO_MENU
MENU_COMPLETE
.
AUTO_NAME_DIRS
%~
'
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
}
', `:
',
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
AUTO_PUSHD
(-N
)
cd
push the old directory onto the directory stack.
AUTO_REMOVE_SLASH
AUTO_RESUME
(-W
)
BAD_PATTERN
(+2
)
BANG_HIST
(+K
)
!
' specially.
BARE_GLOB_QUAL
|
', `(
' or (if special) `~
'
characters. See section Filename Generation.
BEEP
(+B
)
BG_NICE
(-6
)
BRACE_CCL
BSD_ECHO
echo
builtin compatible with the BSD man page echo(1) command.
This disables backslashed escape sequences in echo strings unless the
-e
option is specified.
CDABLE_VARS
(-T
)
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
section Filename Expansion).
CHASE_LINKS
(-w
)
CLOBBER
(+C
, ksh: +C
)
>
' redirection to truncate existing files,
and `>>
' to create files.
Otherwise `>!
' or `>|
' must be used to truncate a file,
and `>>!
' or `>>|
' to create a file.
COMPLETE_ALIASES
COMPLETE_IN_WORD
CORRECT
(-0
)
CORRECT_ALL
(-O
)
CSH_JUNKIE_HISTORY
CSH_JUNKIE_LOOPS
end
' instead of
`do
list; done
'.
CSH_JUNKIE_QUOTES
$
', ``
'
or `"
' (and `\
' itself no longer needs escaping).
Command substitutions are only expanded once, and cannot be nested.
CSH_NULL_GLOB
NULL_GLOB
.
EQUALS
=
filename substitution.
(See section Filename Expansion.)
ERR_EXIT
(-e
, ksh: -e
)
ZERR
trap, if set, and exit. This is disabled while running initialization
scripts.
EXEC
(+n
, ksh: +n
)
EXTENDED_GLOB
#
', `~
' and `^
' characters as part of patterns
for filename generation, etc. (An initial unquoted `~
'
always produces named directory expansion.)
EXTENDED_HISTORY
:
<beginning time>:
<ending time>:
<command>'.
FLOW_CONTROL
FUNCTION_ARGZERO
$0
temporarily to the name of the function/script.
GLOB
(+F
, ksh: +f
)
GLOB_ASSIGN
=
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_COMPLETE
MENU_COMPLETE
. If no matches are found, a `*
' is added to the end of the
word or inserted at the cursor if COMPLETE_IN_WORD
is set, and expansion
is attempted again. Using patterns works not only for files but for all
completions, such as options, user names, etc.
GLOB_DOTS
(-4
)
.
' in a filename to be matched explicitly.
GLOB_SUBST
HASH_CMDS
HASH_DIRS
HASH_CMDS
is unset.
HASH_LIST_ALL
HIST_ALLOW_CLOBBER
|
' to output redirections in the history. This allows history
references to clobber files even when CLOBBER
is unset.
HIST_BEEP
HIST_IGNORE_DUPS
(-h
)
HIST_IGNORE_SPACE
(-g
)
HIST_NO_FUNCTIONS
HIST_NO_STORE
history
(fc -l
) command from
the history when invoked.
HIST_REDUCE_BLANKS
HIST_VERIFY
HUP
HUP
signal to running jobs when the
shell exits.
IGNORE_BRACES
(-I
)
IGNORE_EOF
(-7
)
exit
or logout
instead.
However, ten consecutive EOFs will cause the shell to exit anyway,
to avoid the shell hanging if its tty goes away.
INTERACTIVE
(-i
, ksh: -i
)
SHIN_STDIN
.)
This heuristic may be overridden by specifying a state for this option
on the command line.
The value of this option cannot be changed anywhere other than the command line.
INTERACTIVE_COMMENTS
(-k
)
KSH_ARRAYS
${path[2]}
' rather
than just `$path[2]
').
KSH_AUTOLOAD
KSH_GLOB
@
', `*
', `+
', `?
' or `!
'.
See section Filename Generation.
KSH_OPTION_PRINT
LIST_AMBIGUOUS
LIST_BEEP
LIST_TYPES
(-X
)
LOCAL_OPTIONS
XTRACE
and PRINT_EXIT_VALUE
options are restored. Hence
if this is explicitly unset by a shell function the other options in
force at the point of return will remain so.
A shell function can also guarantee itself a known shell configuration
with a formulation like `emulate zsh; setopt localoptions
'.
LOGIN
(-l
, ksh: -l
)
argv[0]
passed to the shell is a `-
'.
LONG_LIST_JOBS
(-R
)
MAGIC_EQUAL_SUBST
=
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.
MAIL_WARNING
(-U
)
MARK_DIRS
(-8
, ksh: -X
)
/
' to all directory
names resulting from filename generation (globbing).
MENU_COMPLETE
(-Y
)
reverse-menu-complete
may be used to loop through the list
in the other direction. This option overrides AUTO_MENU
.
MONITOR
(-m
, ksh: -m
)
MULTIOS
NOMATCH
(+3
)
~
' or `=
'.
NOTIFY
(-5
, ksh: -b
)
NULL_GLOB
(-G
)
NOMATCH
.
NUMERIC_GLOB_SORT
OVERSTRIKE
PATH_DIRS
(-Q
)
/usr/local/bin
' is in the user's path, and he types
`X11/xinit
', the command `/usr/local/bin/X11/xinit
' will be executed
(assuming it exists).
Commands explicitly beginning with `/
', `./
' or `../
'
are not subject to the path search.
This also applies to the .
builtin,
and searches for modules performed by the zmodload
builtin.
POSIX_BUILTINS
command
builtin can be used to execute
shell builtin commands. Parameter assignments specified before shell
functions and special builtins are kept after the command completes unless
the special builtin is prefixed with the command
builtin. Special
builtins are
.
,
:
,
break
,
continue
,
declare
,
eval
,
exit
,
export
,
integer
,
local
,
readonly
,
return
,
set
,
shift
,
source
,
times
,
trap
and
unset
.
PRINT_EIGHT_BIT
PRINT_EXIT_VALUE
(-1
)
PRIVILEGED
(-p
, ksh: -p
)
sh
' or `ksh
' with this option set,
/etc/suid_profile
is sourced (after /etc/profile
on interactive
shells). Sourcing ~/.profile
is disabled and the contents of the
ENV
variable is ignored. This option cannot be changed using the
-m
option of setopt
and unsetopt
, and changing it inside a
function always changes it globally regardless of the LOCAL_OPTIONS
option.
PROMPT_BANG
!
' is treated specially in prompt expansion.
See section Prompt Expansion.
PROMPT_CR
(+V
)
PROMPT_PERCENT
%
' is treated specially in prompt expansion.
See section Prompt Expansion.
PROMPT_SUBST
PUSHD_IGNORE_DUPS
PUSHD_MINUS
+
' and `-
'
when used with a number to specify a directory in the stack.
PUSHD_SILENT
(-E
)
pushd
or popd
.
PUSHD_TO_HOME
(-D
)
pushd
with no arguments act like `pushd $HOME
'.
RC_EXPAND_PARAM
(-P
)
${
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'.
RC_QUOTES
''
' to signify a single quote
within singly quoted strings.
RCS
(+f
)
/etc/zshenv
is sourced on startup, source the
.zshenv
, /etc/zprofile
, .zprofile
,
/etc/zshrc
, .zshrc
, /etc/zlogin
, .zlogin
, and .zlogout
files, as described in section Files.
If this option is unset, only the /etc/zshenv
file is sourced.
REC_EXACT
(-S
)
RESTRICTED
(-r
)
unsetopt
, and setting it inside a function always changes it
globally regardless of the LOCAL_OPTIONS
option. See
section Restricted Shell.
RM_STAR_SILENT
(-H
)
rm *
' or `rm path/*
'.
RM_STAR_WAIT
rm *
' or `rm path/*
',
first wait ten seconds and ignore anything typed in that time.
This avoids the problem of reflexively answering `yes' to the query
when one didn't really mean it. The wait and query can always be
avoided by expanding the `*
' in ZLE (with tab).
SH_FILE_EXPANSION
~$USERNAME
' and
`~{pfalstad,rc}
' will work.
SH_GLOB
(
', `|
', `)
'
and '<
' for globbing the result of parameter and command substitutions,
and in some other places where
the shell accepts patterns. This option is set by default if zsh is
invoked as sh
or ksh
.
SHIN_STDIN
(-s
, ksh: -s
)
-c
and no file of commands is specified. If SHIN_STDIN
is set explicitly on the command line,
any argument that would otherwise have been
taken as a file to run will instead be treated as a normal positional
parameter.
Note that setting or unsetting this option on the command line does not
necessarily affect the state the option will have while the shell is
running - that is purely an indicator of whether on not commands are
actually being read from standard input.
The value of this option cannot be changed anywhere other than the command line.
SH_OPTION_LETTERS
set
and setopt
) like ksh does.
This also affects the value of the -
special parameter.
SHORT_LOOPS
for
, select
,
if
, and function
constructs.
SH_WORD_SPLIT
(-y
)
SINGLE_COMMAND
(-t
, ksh: -t
)
INTERACTIVE
option is explicitly set on the command line.
The value of this option cannot be changed anywhere other than the command line.
SINGLE_LINE_ZLE
(-M
)
SUN_KEYBOARD_HACK
(-L
)
UNSET
(+u
, ksh: +u
)
VERBOSE
(-v
, ksh: -v
)
XTRACE
(-x
, ksh: -x
)
ZLE
(-Z
)
Some options have alternative names. These aliases are never used for output, but can be used just like normal option names when specifying options to the shell.
BRACE_EXPAND
IGNORE_BRACES
(ksh and bash compatibility)
DOT_GLOB
GLOB_DOTS
(bash compatibility)
HASH_ALL
HASH_CMDS
(bash compatibility)
HIST_APPEND
APPEND_HISTORY
(bash compatibility)
HIST_EXPAND
BANG_HIST
(bash compatibility)
LOG
HIST_NO_FUNCTIONS
(ksh compatibility)
MAIL_WARN
MAIL_WARNING
(bash compatibility)
ONE_CMD
SINGLE_COMMAND
(bash compatibility)
PHYSICAL
CHASE_LINKS
(ksh and bash compatibility)
PROMPT_VARS
PROMPT_SUBST
(bash compatibility)
STDIN
SHIN_STDIN
(ksh compatibility)
TRACK_ALL
HASH_CMDS
(ksh compatibility)
-0
-1
-2
-3
-4
-5
-6
-7
-8
-9
-B
-C
-D
-E
-F
-G
-H
-I
-J
-K
-L
-M
-N
-O
-P
-Q
-R
-S
-T
-U
-V
-W
-X
-Y
-Z
-a
-e
-f
-g
-h
-i
-k
-l
-m
-n
-p
-r
-s
-t
-u
-v
-w
-x
-y
-C
-X
-a
-b
-e
-f
-i
-l
-m
-n
-p
-r
-s
-t
-u
-v
-x
-A
set
for setting arrays
-c
-m
setopt
for pattern-matching option setting
-o
-s
set
to sort positional parameters
Go to the first, previous, next, last section, table of contents.