Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: When should interactive option be set/.zshrc read?



>
> This is a completely different matter.  The subshell inherits everything
> from the parent shell after the fork; it never re-initialiases.  It does
> unset the options MONITOR and USEZLE, but not INTERACTIVE, for the
> subshell, however.   One might have thought that it would either change all
> three or none.  In particular, the effect of claiming to be interactive but
> not using ZLE looks a bit weird.  Unless there is some standard behind
> this?
>

Here is what SUS V2 says:

A subshell environment will be created as a duplicate of the shell
environment, except that signal traps set by that shell environment will be
set to the default values. Changes made to the subshell environment will not
affect the shell environment. Command substitution, commands that are grouped
with parentheses and asynchronous lists will be executed in a subshell
environment. Additionally, each command of a multi-command pipeline is in a
subshell environment; as an extension, however, any or all commands in a
pipeline may be executed in the current environment. All other commands will
be executed in the current shell environment.

"Environment" includes current option settings, aliases, functions etc. SUS V2
shell supports job control, and has MONITOR option that is on if shell is
interactive. But it is silent on what happens with these options in subshell.

-andrej




Messages sorted by: Reverse Date, Date, Thread, Author