1ZSHOPTIONS(1) General Commands Manual ZSHOPTIONS(1)
2
3
4
6 zshoptions - zsh options
7
9 Options are primarily referred to by name. These names are case insen‐
10 sitive and underscores are ignored. For example, `allexport' is equiv‐
11 alent to `A__lleXP_ort'.
12
13 The sense of an option name may be inverted by preceding it with `no',
14 so `setopt No_Beep' is equivalent to `unsetopt beep'. This inversion
15 can only be done once, so `nonobeep' is not a synonym for `beep'. Sim‐
16 ilarly, `tify' is not a synonym for `nonotify' (the inversion of
17 `notify').
18
19 Some options also have one or more single letter names. There are two
20 sets of single letter options: one used by default, and another used to
21 emulate sh/ksh (used when the SH_OPTION_LETTERS option is set). The
22 single letter options can be used on the shell command line, or with
23 the set, setopt and unsetopt builtins, as normal Unix options preceded
24 by `-'.
25
26 The sense of the single letter options may be inverted by using `+'
27 instead of `-'. Some of the single letter option names refer to an
28 option being off, in which case the inversion of that name refers to
29 the option being on. For example, `+n' is the short name of `exec',
30 and `-n' is the short name of its inversion, `noexec'.
31
32 In strings of single letter options supplied to the shell at startup,
33 trailing whitespace will be ignored; for example the string `-f '
34 will be treated just as `-f', but the string `-f i' is an error. This
35 is because many systems which implement the `#!' mechanism for calling
36 scripts do not strip trailing whitespace.
37
39 In the following list, options set by default in all emulations are
40 marked <D>; those set by default only in csh, ksh, sh, or zsh emula‐
41 tions are marked <C>, <K>, <S>, <Z> as appropriate. When listing
42 options (by `setopt', `unsetopt', `set -o' or `set +o'), those turned
43 on by default appear in the list prefixed with `no'. Hence (unless
44 KSH_OPTION_PRINT is set), `setopt' shows all options whose settings are
45 changed from the default.
46
47 Changing Directories
48 AUTO_CD (-J)
49 If a command is issued that can't be executed as a normal com‐
50 mand, and the command is the name of a directory, perform the cd
51 command to that directory.
52
53 AUTO_PUSHD (-N)
54 Make cd push the old directory onto the directory stack.
55
56 CDABLE_VARS (-T)
57 If the argument to a cd command (or an implied cd with the
58 AUTO_CD option set) is not a directory, and does not begin with
59 a slash, try to expand the expression as if it were preceded by
60 a `~' (see the section `Filename Expansion').
61
62 CHASE_DOTS
63 When changing to a directory containing a path segment `..'
64 which would otherwise be treated as canceling the previous seg‐
65 ment in the path (in other words, `foo/..' would be removed from
66 the path, or if `..' is the first part of the path, the last
67 part of $PWD would be deleted), instead resolve the path to the
68 physical directory. This option is overridden by CHASE_LINKS.
69
70 For example, suppose /foo/bar is a link to the directory
71 /alt/rod. Without this option set, `cd /foo/bar/..' changes to
72 /foo; with it set, it changes to /alt. The same applies if the
73 current directory is /foo/bar and `cd ..' is used. Note that
74 all other symbolic links in the path will also be resolved.
75
76 CHASE_LINKS (-w)
77 Resolve symbolic links to their true values when changing direc‐
78 tory. This also has the effect of CHASE_DOTS, i.e. a `..' path
79 segment will be treated as referring to the physical parent,
80 even if the preceding path segment is a symbolic link.
81
82 PUSHD_IGNORE_DUPS
83 Don't push multiple copies of the same directory onto the direc‐
84 tory stack.
85
86 PUSHD_MINUS
87 Exchanges the meanings of `+' and `-' when used with a number to
88 specify a directory in the stack.
89
90 PUSHD_SILENT (-E)
91 Do not print the directory stack after pushd or popd.
92
93 PUSHD_TO_HOME (-D)
94 Have pushd with no arguments act like `pushd $HOME'.
95
96 Completion
97 ALWAYS_LAST_PROMPT <D>
98 If unset, key functions that list completions try to return to
99 the last prompt if given a numeric argument. If set these func‐
100 tions try to return to the last prompt if given no numeric argu‐
101 ment.
102
103 ALWAYS_TO_END
104 If a completion is performed with the cursor within a word, and
105 a full completion is inserted, the cursor is moved to the end of
106 the word. That is, the cursor is moved to the end of the word
107 if either a single match is inserted or menu completion is per‐
108 formed.
109
110 AUTO_LIST (-9) <D>
111 Automatically list choices on an ambiguous completion.
112
113 AUTO_MENU <D>
114 Automatically use menu completion after the second consecutive
115 request for completion, for example by pressing the tab key
116 repeatedly. This option is overridden by MENU_COMPLETE.
117
118 AUTO_NAME_DIRS
119 Any parameter that is set to the absolute name of a directory
120 immediately becomes a name for that directory, that will be used
121 by the `%~' and related prompt sequences, and will be available
122 when completion is performed on a word starting with `~'. (Oth‐
123 erwise, the parameter must be used in the form `~param' first.)
124
125 AUTO_PARAM_KEYS <D>
126 If a parameter name was completed and a following character
127 (normally a space) automatically inserted, and the next charac‐
128 ter typed is one of those that have to come directly after the
129 name (like `}', `:', etc.), the automatically added character is
130 deleted, so that the character typed comes immediately after the
131 parameter name. Completion in a brace expansion is affected
132 similarly: the added character is a `,', which will be removed
133 if `}' is typed next.
134
135 AUTO_PARAM_SLASH <D>
136 If a parameter is completed whose content is the name of a
137 directory, then add a trailing slash instead of a space.
138
139 AUTO_REMOVE_SLASH <D>
140 When the last character resulting from a completion is a slash
141 and the next character typed is a word delimiter, a slash, or a
142 character that ends a command (such as a semicolon or an amper‐
143 sand), remove the slash.
144
145 BASH_AUTO_LIST
146 On an ambiguous completion, automatically list choices when the
147 completion function is called twice in succession. This takes
148 precedence over AUTO_LIST. The setting of LIST_AMBIGUOUS is
149 respected. If AUTO_MENU is set, the menu behaviour will then
150 start with the third press. Note that this will not work with
151 MENU_COMPLETE, since repeated completion calls immediately cycle
152 through the list in that case.
153
154 COMPLETE_ALIASES
155 Prevents aliases on the command line from being internally sub‐
156 stituted before completion is attempted. The effect is to make
157 the alias a distinct command for completion purposes.
158
159 COMPLETE_IN_WORD
160 If unset, the cursor is set to the end of the word if completion
161 is started. Otherwise it stays there and completion is done from
162 both ends.
163
164 GLOB_COMPLETE
165 When the current word has a glob pattern, do not insert all the
166 words resulting from the expansion but generate matches as for
167 completion and cycle through them like MENU_COMPLETE. The
168 matches are generated as if a `*' was added to the end of the
169 word, or inserted at the cursor when COMPLETE_IN_WORD is set.
170 This actually uses pattern matching, not globbing, so it works
171 not only for files but for any completion, such as options, user
172 names, etc.
173
174 Note that when the pattern matcher is used, matching control
175 (for example, case-insensitive or anchored matching) cannot be
176 used. This limitation only applies when the current word con‐
177 tains a pattern; simply turning on the GLOB_COMPLETE option does
178 not have this effect.
179
180 HASH_LIST_ALL <D>
181 Whenever a command completion is attempted, make sure the entire
182 command path is hashed first. This makes the first completion
183 slower.
184
185 LIST_AMBIGUOUS <D>
186 This option works when AUTO_LIST or BASH_AUTO_LIST is also set.
187 If there is an unambiguous prefix to insert on the command line,
188 that is done without a completion list being displayed; in other
189 words, auto-listing behaviour only takes place when nothing
190 would be inserted. In the case of BASH_AUTO_LIST, this means
191 that the list will be delayed to the third call of the function.
192
193 LIST_BEEP <D>
194 Beep on an ambiguous completion. More accurately, this forces
195 the completion widgets to return status 1 on an ambiguous com‐
196 pletion, which causes the shell to beep if the option BEEP is
197 also set; this may be modified if completion is called from a
198 user-defined widget.
199
200 LIST_PACKED
201 Try to make the completion list smaller (occupying less lines)
202 by printing the matches in columns with different widths.
203
204 LIST_ROWS_FIRST
205 Lay out the matches in completion lists sorted horizontally,
206 that is, the second match is to the right of the first one, not
207 under it as usual.
208
209 LIST_TYPES (-X) <D>
210 When listing files that are possible completions, show the type
211 of each file with a trailing identifying mark.
212
213 MENU_COMPLETE (-Y)
214 On an ambiguous completion, instead of listing possibilities or
215 beeping, insert the first match immediately. Then when comple‐
216 tion is requested again, remove the first match and insert the
217 second match, etc. When there are no more matches, go back to
218 the first one again. reverse-menu-complete may be used to loop
219 through the list in the other direction. This option overrides
220 AUTO_MENU.
221
222 REC_EXACT (-S)
223 In completion, recognize exact matches even if they are ambigu‐
224 ous.
225
226 Expansion and Globbing
227 BAD_PATTERN (+2) <C> <Z>
228 If a pattern for filename generation is badly formed, print an
229 error message. (If this option is unset, the pattern will be
230 left unchanged.)
231
232 BARE_GLOB_QUAL <Z>
233 In a glob pattern, treat a trailing set of parentheses as a
234 qualifier list, if it contains no `|', `(' or (if special) `~'
235 characters. See the section `Filename Generation'.
236
237 BRACE_CCL
238 Expand expressions in braces which would not otherwise undergo
239 brace expansion to a lexically ordered list of all the charac‐
240 ters. See the section `Brace Expansion'.
241
242 CASE_GLOB <D>
243 Make globbing (filename generation) sensitive to case. Note
244 that other uses of patterns are always sensitive to case. If
245 the option is unset, the presence of any character which is spe‐
246 cial to filename generation will cause case-insensitive match‐
247 ing. For example, cvs(/) can match the directory CVS owing to
248 the presence of the globbing flag (unless the option
249 BARE_GLOB_QUAL is unset).
250
251 CSH_NULL_GLOB <C>
252 If a pattern for filename generation has no matches, delete the
253 pattern from the argument list; do not report an error unless
254 all the patterns in a command have no matches. Overrides
255 NOMATCH.
256
257 EQUALS <Z>
258 Perform = filename expansion. (See the section `Filename Expan‐
259 sion'.)
260
261 EXTENDED_GLOB
262 Treat the `#', `~' and `^' characters as part of patterns for
263 filename generation, etc. (An initial unquoted `~' always pro‐
264 duces named directory expansion.)
265
266 GLOB (+F, ksh: +f) <D>
267 Perform filename generation (globbing). (See the section `File‐
268 name Generation'.)
269
270 GLOB_ASSIGN <C>
271 If this option is set, filename generation (globbing) is per‐
272 formed on the right hand side of scalar parameter assignments of
273 the form `name=pattern (e.g. `foo=*'). If the result has more
274 than one word the parameter will become an array with those
275 words as arguments. This option is provided for backwards com‐
276 patibility only: globbing is always performed on the right hand
277 side of array assignments of the form `name=(value)' (e.g.
278 `foo=(*)') and this form is recommended for clarity; with this
279 option set, it is not possible to predict whether the result
280 will be an array or a scalar.
281
282 GLOB_DOTS (-4)
283 Do not require a leading `.' in a filename to be matched explic‐
284 itly.
285
286 GLOB_SUBST <C> <K> <S>
287 Treat any characters resulting from parameter expansion as being
288 eligible for file expansion and filename generation, and any
289 characters resulting from command substitution as being eligible
290 for filename generation. Braces (and commas in between) do not
291 become eligible for expansion.
292
293 IGNORE_BRACES (-I) <S>
294 Do not perform brace expansion.
295
296 KSH_GLOB <K>
297 In pattern matching, the interpretation of parentheses is
298 affected by a preceding `@', `*', `+', `?' or `!'. See the sec‐
299 tion `Filename Generation'.
300
301 MAGIC_EQUAL_SUBST
302 All unquoted arguments of the form `anything=expression' appear‐
303 ing after the command name have filename expansion (that is,
304 where expression has a leading `~' or `=') performed on expres‐
305 sion as if it were a parameter assignment. The argument is not
306 otherwise treated specially; it is passed to the command as a
307 single argument, and not used as an actual parameter assignment.
308 For example, in echo foo=~/bar:~/rod, both occurrences of ~
309 would be replaced. Note that this happens anyway with typeset
310 and similar statements.
311
312 This option respects the setting of the KSH_TYPESET option. In
313 other words, if both options are in effect, arguments looking
314 like assignments will not undergo wordsplitting.
315
316 MARK_DIRS (-8, ksh: -X)
317 Append a trailing `/' to all directory names resulting from
318 filename generation (globbing).
319
320 NOMATCH (+3) <C> <Z>
321 If a pattern for filename generation has no matches, print an
322 error, instead of leaving it unchanged in the argument list.
323 This also applies to file expansion of an initial `~' or `='.
324
325 NULL_GLOB (-G)
326 If a pattern for filename generation has no matches, delete the
327 pattern from the argument list instead of reporting an error.
328 Overrides NOMATCH.
329
330 NUMERIC_GLOB_SORT
331 If numeric filenames are matched by a filename generation pat‐
332 tern, sort the filenames numerically rather than lexicographi‐
333 cally.
334
335 RC_EXPAND_PARAM (-P)
336 Array expansions of the form `foo${xx}bar', where the parameter
337 xx is set to (a b c), are substituted with `fooabar foobbar
338 foocbar' instead of the default `fooa b cbar'.
339
340 SH_GLOB <K> <S>
341 Disables the special meaning of `(', `|', `)' and '<' for glob‐
342 bing the result of parameter and command substitutions, and in
343 some other places where the shell accepts patterns. This option
344 is set by default if zsh is invoked as sh or ksh.
345
346 UNSET (+u, ksh: +u) <K> <S> <Z>
347 Treat unset parameters as if they were empty when substituting.
348 Otherwise they are treated as an error.
349
350 History
351 APPEND_HISTORY <D>
352 If this is set, zsh sessions will append their history list to
353 the history file, rather than overwrite it. Thus, multiple par‐
354 allel zsh sessions will all have their history lists added to
355 the history file, in the order they are killed.
356
357 BANG_HIST (+K) <C> <Z>
358 Perform textual history expansion, csh-style, treating the char‐
359 acter `!' specially.
360
361 EXTENDED_HISTORY <C>
362 Save each command's beginning timestamp (in seconds since the
363 epoch) and the duration (in seconds) to the history file. The
364 format of this prefixed data is:
365
366 `:<beginning time>:<elapsed seconds>:<command>'.
367
368 HIST_ALLOW_CLOBBER
369 Add `|' to output redirections in the history. This allows his‐
370 tory references to clobber files even when CLOBBER is unset.
371
372 HIST_BEEP <D>
373 Beep when an attempt is made to access a history entry which
374 isn't there.
375
376 HIST_EXPIRE_DUPS_FIRST
377 If the internal history needs to be trimmed to add the current
378 command line, setting this option will cause the oldest history
379 event that has a duplicate to be lost before losing a unique
380 event from the list. You should be sure to set the value of
381 HISTSIZE to a larger number than SAVEHIST in order to give you
382 some room for the duplicated events, otherwise this option will
383 behave just like HIST_IGNORE_ALL_DUPS once the history fills up
384 with unique events.
385
386 HIST_FIND_NO_DUPS
387 When searching for history entries in the line editor, do not
388 display duplicates of a line previously found, even if the
389 duplicates are not contiguous.
390
391 HIST_IGNORE_ALL_DUPS
392 If a new command line being added to the history list duplicates
393 an older one, the older command is removed from the list (even
394 if it is not the previous event).
395
396 HIST_IGNORE_DUPS (-h)
397 Do not enter command lines into the history list if they are
398 duplicates of the previous event.
399
400 HIST_IGNORE_SPACE (-g)
401 Remove command lines from the history list when the first char‐
402 acter on the line is a space, or when one of the expanded
403 aliases contains a leading space. Note that the command lingers
404 in the internal history until the next command is entered before
405 it vanishes, allowing you to briefly reuse or edit the line. If
406 you want to make it vanish right away without entering another
407 command, type a space and press return.
408
409 HIST_NO_FUNCTIONS
410 Remove function definitions from the history list. Note that
411 the function lingers in the internal history until the next com‐
412 mand is entered before it vanishes, allowing you to briefly re‐
413 use or edit the definition.
414
415 HIST_NO_STORE
416 Remove the history (fc -l) command from the history list when
417 invoked. Note that the command lingers in the internal history
418 until the next command is entered before it vanishes, allowing
419 you to briefly reuse or edit the line.
420
421 HIST_REDUCE_BLANKS
422 Remove superfluous blanks from each command line being added to
423 the history list.
424
425 HIST_SAVE_NO_DUPS
426 When writing out the history file, older commands that duplicate
427 newer ones are omitted.
428
429 HIST_VERIFY
430 Whenever the user enters a line with history expansion, don't
431 execute the line directly; instead, perform history expansion
432 and reload the line into the editing buffer.
433
434 INC_APPEND_HISTORY
435 This options works like APPEND_HISTORY except that new history
436 lines are added to the $HISTFILE incrementally (as soon as they
437 are entered), rather than waiting until the shell is killed.
438 The file is periodically trimmed to the number of lines speci‐
439 fied by $SAVEHIST, but can exceed this value between trimmings.
440
441 SHARE_HISTORY <K>
442
443 This option both imports new commands from the history file, and
444 also causes your typed commands to be appended to the history
445 file (the latter is like specifying INC_APPEND_HISTORY). The
446 history lines are also output with timestamps ala EXTENDED_HIS‐
447 TORY (which makes it easier to find the spot where we left off
448 reading the file after it gets re-written).
449
450 By default, history movement commands visit the imported lines
451 as well as the local lines, but you can toggle this on and off
452 with the set-local-history zle binding. It is also possible to
453 create a zle widget that will make some commands ignore imported
454 commands, and some include them.
455
456 If you find that you want more control over when commands get
457 imported, you may wish to turn SHARE_HISTORY off,
458 INC_APPEND_HISTORY on, and then manually import commands when‐
459 ever you need them using `fc -RI'.
460
461 Initialisation
462 ALL_EXPORT (-a, ksh: -a)
463 All parameters subsequently defined are automatically exported.
464
465 GLOBAL_EXPORT (<Z>)
466 If this option is set, passing the -x flag to the builtins
467 declare, float, integer, readonly and typeset (but not local)
468 will also set the -g flag; hence parameters exported to the
469 environment will not be made local to the enclosing function,
470 unless they were already or the flag +g is given explicitly. If
471 the option is unset, exported parameters will be made local in
472 just the same way as any other parameter.
473
474 This option is set by default for backward compatibility; it is
475 not recommended that its behaviour be relied upon. Note that
476 the builtin export always sets both the -x and -g flags, and
477 hence its effect extends beyond the scope of the enclosing func‐
478 tion; this is the most portable way to achieve this behaviour.
479
480 GLOBAL_RCS (-d) <D>
481 If this option is unset, the startup files /etc/zprofile,
482 /etc/zshrc, /etc/zlogin and /etc/zlogout will not be run. It
483 can be disabled and re-enabled at any time, including inside
484 local startup files (.zshrc, etc.).
485
486 RCS (+f) <D>
487 After /etc/zshenv is sourced on startup, source the .zshenv,
488 /etc/zprofile, .zprofile, /etc/zshrc, .zshrc, /etc/zlogin, .zlo‐
489 gin, and .zlogout files, as described in the section `Files'.
490 If this option is unset, the /etc/zshenv file is still sourced,
491 but any of the others will not be; it can be set at any time to
492 prevent the remaining startup files after the currently execut‐
493 ing one from being sourced.
494
495 Input/Output
496 ALIASES <D>
497 Expand aliases.
498
499 CLOBBER (+C, ksh: +C) <D>
500 Allows `>' redirection to truncate existing files, and `>>' to
501 create files. Otherwise `>!' or `>|' must be used to truncate a
502 file, and `>>!' or `>>|' to create a file.
503
504 CORRECT (-0)
505 Try to correct the spelling of commands. Note that, when the
506 HASH_LIST_ALL option is not set or when some directories in the
507 path are not readable, this may falsely report spelling errors
508 the first time some commands are used.
509
510 CORRECT_ALL (-O)
511 Try to correct the spelling of all arguments in a line.
512
513 DVORAK Use the Dvorak keyboard instead of the standard qwerty keyboard
514 as a basis for examining spelling mistakes for the CORRECT and
515 CORRECT_ALL options and the spell-word editor command.
516
517 FLOW_CONTROL <D>
518 If this option is unset, output flow control via start/stop
519 characters (usually assigned to ^S/^Q) is disabled in the
520 shell's editor.
521
522 IGNORE_EOF (-7)
523 Do not exit on end-of-file. Require the use of exit or logout
524 instead. However, ten consecutive EOFs will cause the shell to
525 exit anyway, to avoid the shell hanging if its tty goes away.
526
527 Also, if this option is set and the Zsh Line Editor is used,
528 widgets implemented by shell functions can be bound to EOF (nor‐
529 mally Control-D) without printing the normal warning message.
530 This works only for normal widgets, not for completion widgets.
531
532 INTERACTIVE_COMMENTS (-k) <K> <S>
533 Allow comments even in interactive shells.
534
535 HASH_CMDS <D>
536 Note the location of each command the first time it is executed.
537 Subsequent invocations of the same command will use the saved
538 location, avoiding a path search. If this option is unset, no
539 path hashing is done at all. However, when CORRECT is set, com‐
540 mands whose names do not appear in the functions or aliases hash
541 tables are hashed in order to avoid reporting them as spelling
542 errors.
543
544 HASH_DIRS <D>
545 Whenever a command name is hashed, hash the directory containing
546 it, as well as all directories that occur earlier in the path.
547 Has no effect if neither HASH_CMDS nor CORRECT is set.
548
549 MAIL_WARNING (-U)
550 Print a warning message if a mail file has been accessed since
551 the shell last checked.
552
553 PATH_DIRS (-Q)
554 Perform a path search even on command names with slashes in
555 them. Thus if `/usr/local/bin' is in the user's path, and he or
556 she types `X11/xinit', the command `/usr/local/bin/X11/xinit'
557 will be executed (assuming it exists). Commands explicitly
558 beginning with `/', `./' or `../' are not subject to the path
559 search. This also applies to the . builtin.
560
561 Note that subdirectories of the current directory are always
562 searched for executables specified in this form. This takes
563 place before any search indicated by this option, and regardless
564 of whether `.' or the current directory appear in the command
565 search path.
566
567 PRINT_EIGHT_BIT
568 Print eight bit characters literally in completion lists, etc.
569 This option is not necessary if your system correctly returns
570 the printability of eight bit characters (see ctype(3)).
571
572 PRINT_EXIT_VALUE (-1)
573 Print the exit value of programs with non-zero exit status.
574
575 RC_QUOTES
576 Allow the character sequence `''' to signify a single quote
577 within singly quoted strings. Note this does not apply in
578 quoted strings using the format $'...', where a backslashed sin‐
579 gle quote can be used.
580
581 RM_STAR_SILENT (-H) <K> <S>
582 Do not query the user before executing `rm *' or `rm path/*'.
583
584 RM_STAR_WAIT
585 If querying the user before executing `rm *' or `rm path/*',
586 first wait ten seconds and ignore anything typed in that time.
587 This avoids the problem of reflexively answering `yes' to the
588 query when one didn't really mean it. The wait and query can
589 always be avoided by expanding the `*' in ZLE (with tab).
590
591 SHORT_LOOPS <C> <Z>
592 Allow the short forms of for, repeat, select, if, and function
593 constructs.
594
595 SUN_KEYBOARD_HACK (-L)
596 If a line ends with a backquote, and there are an odd number of
597 backquotes on the line, ignore the trailing backquote. This is
598 useful on some keyboards where the return key is too small, and
599 the backquote key lies annoyingly close to it.
600
601 Job Control
602 AUTO_CONTINUE
603 With this option set, stopped jobs that are removed from the job
604 table with the disown builtin command are automatically sent a
605 CONT signal to make them running.
606
607 AUTO_RESUME (-W)
608 Treat single word simple commands without redirection as candi‐
609 dates for resumption of an existing job.
610
611 BG_NICE (-6) <C> <Z>
612 Run all background jobs at a lower priority. This option is set
613 by default.
614
615 CHECK_JOBS <Z>
616 Report the status of background and suspended jobs before exit‐
617 ing a shell with job control; a second attempt to exit the shell
618 will succeed. NO_CHECK_JOBS is best used only in combination
619 with NO_HUP, else such jobs will be killed automatically.
620
621 The check is omitted if the commands run from the previous com‐
622 mand line included a `jobs' command, since it is assumed the
623 user is aware that there are background or suspended jobs. A
624 `jobs' command run from the precmd function is not counted for
625 this purpose.
626
627 HUP <Z>
628 Send the HUP signal to running jobs when the shell exits.
629
630 LONG_LIST_JOBS (-R)
631 List jobs in the long format by default.
632
633 MONITOR (-m, ksh: -m)
634 Allow job control. Set by default in interactive shells.
635
636 NOTIFY (-5, ksh: -b) <Z>
637 Report the status of background jobs immediately, rather than
638 waiting until just before printing a prompt.
639
640 Prompting
641 PROMPT_BANG <K>
642 If set, `!' is treated specially in prompt expansion. See the
643 section `Prompt Expansion'.
644
645 PROMPT_CR (+V) <D>
646 Print a carriage return just before printing a prompt in the
647 line editor. This is on by default as multi-line editing is
648 only possible if the editor knows where the start of the line
649 appears.
650
651 PROMPT_PERCENT <C> <Z>
652 If set, `%' is treated specially in prompt expansion. See the
653 section `Prompt Expansion'.
654
655 PROMPT_SUBST <K>
656 If set, parameter expansion, command substitution and arithmetic
657 expansion are performed in prompts. Substitutions within
658 prompts do not affect the command status.
659
660 TRANSIENT_RPROMPT
661 Remove any right prompt from display when accepting a command
662 line. This may be useful with terminals with other cut/paste
663 methods.
664
665 Scripts and Functions
666 C_BASES
667 Output hexadecimal numbers in the standard C format, for example
668 `0xFF' instead of the usual `16#FF'. If the option OCTAL_ZEROES
669 is also set (it is not by default), octal numbers will be
670 treated similarly and hence appear as `077' instead of `8#77'.
671 This option has no effect on the choice of the output base, nor
672 on the output of bases other than hexadecimal and octal. Note
673 that these formats will be understood on input irrespective of
674 the setting of C_BASES.
675
676 ERR_EXIT (-e, ksh: -e)
677 If a command has a non-zero exit status, execute the ZERR trap,
678 if set, and exit. This is disabled while running initialization
679 scripts.
680
681 ERR_RETURN
682 If a command has a non-zero exit status, return immediately from
683 the enclosing function. The logic is identical to that for
684 ERR_EXIT, except that an implicit return statement is executed
685 instead of an exit. This will trigger an exit at the outermost
686 level of a non-interactive script.
687
688 EVAL_LINENO <Z>
689 If set, line numbers of expressions evaluated using the builtin
690 eval are tracked separately of the enclosing environment. This
691 applies both to the parameter LINENO and the line number output
692 by the prompt escape %i. If the option is set, the prompt
693 escape %N will output the string `(eval)' instead of the script
694 or function name as an indication. (The two prompt escapes are
695 typically used in the parameter PS4 to be output when the option
696 XTRACE is set.) If EVAL_LINENO is unset, the line number of the
697 surrounding script or function is retained during the evalua‐
698 tion.
699
700 EXEC (+n, ksh: +n) <D>
701 Do execute commands. Without this option, commands are read and
702 checked for syntax errors, but not executed. This option cannot
703 be turned off in an interactive shell, except when `-n' is sup‐
704 plied to the shell at startup.
705
706 FUNCTION_ARGZERO <C> <Z>
707 When executing a shell function or sourcing a script, set $0
708 temporarily to the name of the function/script.
709
710 LOCAL_OPTIONS <K>
711 If this option is set at the point of return from a shell func‐
712 tion, all the options (including this one) which were in force
713 upon entry to the function are restored. Otherwise, only this
714 option and the XTRACE and PRINT_EXIT_VALUE options are restored.
715 Hence if this is explicitly unset by a shell function the other
716 options in force at the point of return will remain so. A shell
717 function can also guarantee itself a known shell configuration
718 with a formulation like `emulate -L zsh'; the -L activates
719 LOCAL_OPTIONS.
720
721 LOCAL_TRAPS <K>
722 If this option is set when a signal trap is set inside a func‐
723 tion, then the previous status of the trap for that signal will
724 be restored when the function exits. Note that this option must
725 be set prior to altering the trap behaviour in a function;
726 unlike LOCAL_OPTIONS, the value on exit from the function is
727 irrelevant. However, it does not need to be set before any
728 global trap for that to be correctly restored by a function.
729 For example,
730
731 unsetopt localtraps
732 trap - INT
733 fn() { setopt localtraps; trap '' INT; sleep 3; }
734
735 will restore normally handling of SIGINT after the function
736 exits.
737
738 MULTIOS <Z>
739 Perform implicit tees or cats when multiple redirections are
740 attempted (see the section `Redirection').
741
742 OCTAL_ZEROES <S>
743 Interpret any integer constant beginning with a 0 as octal, per
744 IEEE Std 1003.2-1992 (ISO 9945-2:1993). This is not enabled by
745 default as it causes problems with parsing of, for example, date
746 and time strings with leading zeroes.
747
748 TYPESET_SILENT
749 If this is unset, executing any of the `typeset' family of com‐
750 mands with no options and a list of parameters that have no val‐
751 ues to be assigned but already exist will display the value of
752 the parameter. If the option is set, they will only be shown
753 when parameters are selected with the `-m' option. The option
754 `-p' is available whether or not the option is set.
755
756 VERBOSE (-v, ksh: -v)
757 Print shell input lines as they are read.
758
759 XTRACE (-x, ksh: -x)
760 Print commands and their arguments as they are executed.
761
762 Shell Emulation
763 BSD_ECHO <S>
764 Make the echo builtin compatible with the BSD echo(1) command.
765 This disables backslashed escape sequences in echo strings
766 unless the -e option is specified.
767
768 CSH_JUNKIE_HISTORY <C>
769 A history reference without an event specifier will always refer
770 to the previous command. Without this option, such a history
771 reference refers to the same event as the previous history ref‐
772 erence, defaulting to the previous command.
773
774 CSH_JUNKIE_LOOPS <C>
775 Allow loop bodies to take the form `list; end' instead of `do
776 list; done'.
777
778 CSH_JUNKIE_QUOTES <C>
779 Changes the rules for single- and double-quoted text to match
780 that of csh. These require that embedded newlines be preceded
781 by a backslash; unescaped newlines will cause an error message.
782 In double-quoted strings, it is made impossible to escape `$',
783 ``' or `"' (and `\' itself no longer needs escaping). Command
784 substitutions are only expanded once, and cannot be nested.
785
786 CSH_NULLCMD <C>
787 Do not use the values of NULLCMD and READNULLCMD when running
788 redirections with no command. This make such redirections fail
789 (see the section `Redirection').
790
791 KSH_ARRAYS <K> <S>
792 Emulate ksh array handling as closely as possible. If this
793 option is set, array elements are numbered from zero, an array
794 parameter without subscript refers to the first element instead
795 of the whole array, and braces are required to delimit a sub‐
796 script (`${path[2]}' rather than just `$path[2]').
797
798 KSH_AUTOLOAD <K> <S>
799 Emulate ksh function autoloading. This means that when a func‐
800 tion is autoloaded, the corresponding file is merely executed,
801 and must define the function itself. (By default, the function
802 is defined to the contents of the file. However, the most com‐
803 mon ksh-style case - of the file containing only a simple defi‐
804 nition of the function - is always handled in the ksh-compatible
805 manner.)
806
807 KSH_OPTION_PRINT <K>
808 Alters the way options settings are printed: instead of separate
809 lists of set and unset options, all options are shown, marked
810 `on' if they are in the non-default state, `off' otherwise.
811
812 KSH_TYPESET <K>
813 Alters the way arguments to the typeset family of commands,
814 including declare, export, float, integer, local and readonly,
815 are processed. Without this option, zsh will perform normal
816 word splitting after command and parameter expansion in argu‐
817 ments of an assignment; with it, word splitting does not take
818 place in those cases.
819
820 POSIX_BUILTINS <K> <S>
821 When this option is set the command builtin can be used to exe‐
822 cute shell builtin commands. Parameter assignments specified
823 before shell functions and special builtins are kept after the
824 command completes unless the special builtin is prefixed with
825 the command builtin. Special builtins are ., :, break, con‐
826 tinue, declare, eval, exit, export, integer, local, readonly,
827 return, set, shift, source, times, trap and unset.
828
829 SH_FILE_EXPANSION <K> <S>
830 Perform filename expansion (e.g., ~ expansion) before parameter
831 expansion, command substitution, arithmetic expansion and brace
832 expansion. If this option is unset, it is performed after brace
833 expansion, so things like `~$USERNAME' and `~{pfalstad,rc}' will
834 work.
835
836 SH_NULLCMD <K> <S>
837 Do not use the values of NULLCMD and READNULLCMD when doing
838 redirections, use `:' instead (see the section `Redirection').
839
840 SH_OPTION_LETTERS <K> <S>
841 If this option is set the shell tries to interpret single letter
842 options (which are used with set and setopt) like ksh does.
843 This also affects the value of the - special parameter.
844
845 SH_WORD_SPLIT (-y) <K> <S>
846 Causes field splitting to be performed on unquoted parameter
847 expansions. Note that this option has nothing to do with word
848 splitting. (See the section `Parameter Expansion'.)
849
850 TRAPS_ASYNC
851 While waiting for a program to exit, handle signals and run
852 traps immediately. Otherwise the trap is run after a child
853 process has exited. Note this does not affect the point at
854 which traps are run for any case other than when the shell is
855 waiting for a child process.
856
857 Shell State
858 INTERACTIVE (-i, ksh: -i)
859 This is an interactive shell. This option is set upon initiali‐
860 sation if the standard input is a tty and commands are being
861 read from standard input. (See the discussion of SHIN_STDIN.)
862 This heuristic may be overridden by specifying a state for this
863 option on the command line. The value of this option cannot be
864 changed anywhere other than the command line.
865
866 LOGIN (-l, ksh: -l)
867 This is a login shell. If this option is not explicitly set,
868 the shell is a login shell if the first character of the argv[0]
869 passed to the shell is a `-'.
870
871 PRIVILEGED (-p, ksh: -p)
872 Turn on privileged mode. This is enabled automatically on
873 startup if the effective user (group) ID is not equal to the
874 real user (group) ID. Turning this option off causes the effec‐
875 tive user and group IDs to be set to the real user and group
876 IDs. This option disables sourcing user startup files. If zsh
877 is invoked as `sh' or `ksh' with this option set, /etc/suid_pro‐
878 file is sourced (after /etc/profile on interactive shells).
879 Sourcing ~/.profile is disabled and the contents of the ENV
880 variable is ignored. This option cannot be changed using the -m
881 option of setopt and unsetopt, and changing it inside a function
882 always changes it globally regardless of the LOCAL_OPTIONS
883 option.
884
885 RESTRICTED (-r)
886 Enables restricted mode. This option cannot be changed using
887 unsetopt, and setting it inside a function always changes it
888 globally regardless of the LOCAL_OPTIONS option. See the sec‐
889 tion `Restricted Shell'.
890
891 SHIN_STDIN (-s, ksh: -s)
892 Commands are being read from the standard input. Commands are
893 read from standard input if no command is specified with -c and
894 no file of commands is specified. If SHIN_STDIN is set explic‐
895 itly on the command line, any argument that would otherwise have
896 been taken as a file to run will instead be treated as a normal
897 positional parameter. Note that setting or unsetting this
898 option on the command line does not necessarily affect the state
899 the option will have while the shell is running - that is purely
900 an indicator of whether on not commands are actually being read
901 from standard input. The value of this option cannot be changed
902 anywhere other than the command line.
903
904 SINGLE_COMMAND (-t, ksh: -t)
905 If the shell is reading from standard input, it exits after a
906 single command has been executed. This also makes the shell
907 non-interactive, unless the INTERACTIVE option is explicitly set
908 on the command line. The value of this option cannot be changed
909 anywhere other than the command line.
910
911 Zle
912 BEEP (+B) <D>
913 Beep on error in ZLE.
914
915 EMACS If ZLE is loaded, turning on this option has the equivalent
916 effect of `bindkey -e'. In addition, the VI option is unset.
917 Turning it off has no effect. The option setting is not guaran‐
918 teed to reflect the current keymap. This option is provided for
919 compatibility; bindkey is the recommended interface.
920
921 OVERSTRIKE
922 Start up the line editor in overstrike mode.
923
924 SINGLE_LINE_ZLE (-M) <K>
925 Use single-line command line editing instead of multi-line.
926
927 VI If ZLE is loaded, turning on this option has the equivalent
928 effect of `bindkey -v'. In addition, the EMACS option is unset.
929 Turning it off has no effect. The option setting is not guaran‐
930 teed to reflect the current keymap. This option is provided for
931 compatibility; bindkey is the recommended interface.
932
933 ZLE (-Z)
934 Use the zsh line editor. Set by default in interactive shells
935 connected to a terminal.
936
938 Some options have alternative names. These aliases are never used for
939 output, but can be used just like normal option names when specifying
940 options to the shell.
941
942 BRACE_EXPAND
943 NO_IGNORE_BRACES (ksh and bash compatibility)
944
945 DOT_GLOB
946 GLOB_DOTS (bash compatibility)
947
948 HASH_ALL
949 HASH_CMDS (bash compatibility)
950
951 HIST_APPEND
952 APPEND_HISTORY (bash compatibility)
953
954 HIST_EXPAND
955 BANG_HIST (bash compatibility)
956
957 LOG NO_HIST_NO_FUNCTIONS (ksh compatibility)
958
959 MAIL_WARN
960 MAIL_WARNING (bash compatibility)
961
962 ONE_CMD
963 SINGLE_COMMAND (bash compatibility)
964
965 PHYSICAL
966 CHASE_LINKS (ksh and bash compatibility)
967
968 PROMPT_VARS
969 PROMPT_SUBST (bash compatibility)
970
971 STDIN SHIN_STDIN (ksh compatibility)
972
973 TRACK_ALL
974 HASH_CMDS (ksh compatibility)
975
977 Default set
978 -0 CORRECT
979 -1 PRINT_EXIT_VALUE
980 -2 NO_BAD_PATTERN
981 -3 NO_NOMATCH
982 -4 GLOB_DOTS
983 -5 NOTIFY
984 -6 BG_NICE
985 -7 IGNORE_EOF
986 -8 MARK_DIRS
987 -9 AUTO_LIST
988 -B NO_BEEP
989 -C NO_CLOBBER
990 -D PUSHD_TO_HOME
991 -E PUSHD_SILENT
992 -F NO_GLOB
993 -G NULL_GLOB
994 -H RM_STAR_SILENT
995 -I IGNORE_BRACES
996 -J AUTO_CD
997 -K NO_BANG_HIST
998 -L SUN_KEYBOARD_HACK
999 -M SINGLE_LINE_ZLE
1000 -N AUTO_PUSHD
1001 -O CORRECT_ALL
1002 -P RC_EXPAND_PARAM
1003 -Q PATH_DIRS
1004 -R LONG_LIST_JOBS
1005 -S REC_EXACT
1006 -T CDABLE_VARS
1007 -U MAIL_WARNING
1008 -V NO_PROMPT_CR
1009 -W AUTO_RESUME
1010 -X LIST_TYPES
1011 -Y MENU_COMPLETE
1012 -Z ZLE
1013 -a ALL_EXPORT
1014 -e ERR_EXIT
1015 -f NO_RCS
1016 -g HIST_IGNORE_SPACE
1017 -h HIST_IGNORE_DUPS
1018 -i INTERACTIVE
1019 -k INTERACTIVE_COMMENTS
1020 -l LOGIN
1021 -m MONITOR
1022 -n NO_EXEC
1023 -p PRIVILEGED
1024 -r RESTRICTED
1025 -s SHIN_STDIN
1026 -t SINGLE_COMMAND
1027 -u NO_UNSET
1028 -v VERBOSE
1029 -w CHASE_LINKS
1030 -x XTRACE
1031 -y SH_WORD_SPLIT
1032
1033 sh/ksh emulation set
1034 -C NO_CLOBBER
1035 -T TRAPS_ASYNC
1036 -X MARK_DIRS
1037 -a ALL_EXPORT
1038 -b NOTIFY
1039 -e ERR_EXIT
1040 -f NO_GLOB
1041 -i INTERACTIVE
1042 -l LOGIN
1043 -m MONITOR
1044 -n NO_EXEC
1045 -p PRIVILEGED
1046 -r RESTRICTED
1047 -s SHIN_STDIN
1048 -t SINGLE_COMMAND
1049 -u NO_UNSET
1050 -v VERBOSE
1051 -x XTRACE
1052
1053 Also note
1054 -A Used by set for setting arrays
1055 -b Used on the command line to specify end of option processing
1056 -c Used on the command line to specify a single command
1057 -m Used by setopt for pattern-matching option setting
1058 -o Used in all places to allow use of long option names
1059 -s Used by set to sort positional parameters
1060
1061
1062
1063zsh 4.2.6 November 28, 2005 ZSHOPTIONS(1)