0

I am using zsh and if I type setopt it shows

autocd
nobeep
extendedglob
interactive
login
monitor
shinstdin
zle
  • counts 8.

while if I type echo $- it shows :

569BJXZilms
  • counts 11.

Why $- gives more options?

1 Answer 1

1

setopt will only show the options which are changed from the default:

Options that are on by default for the emulation are shown with the prefix no only if they are off, while other options are shown without the prefix no and only if they are on. In addition to options changed from the default state by the user, any options activated automatically by the shell (for example, SHIN_STDIN or INTERACTIVE) will be shown in the list.

The options which are on by default are marked with a <Z> in the zshooptions(1) manpage. For example:

NOTIFY (-5, ksh: -b) <Z>

which appears in $-, but not in the output of setopt.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.