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

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

> Andrej Borsenkow wrote:
> > I was sure, that my .zshrc was read only by interactice zsh, but
> >
> > bor@itsrm2% print $options[interactive]
> > on <= correct
> > bor@itsrm2% : | (print $options[interactive])
> > on <= ?? I doubt, this shell can be considered "interactive"
> It's a copy of the interactive shell, a subshell. It doesn't read any
> init files whatsoever.

Um, really. Which is even worse.

> Hm, but maybe we should turn off the option in subshells. (And probably
> other options, too?)
> Non-interactive shells do things like running shell scripts (`#!.../zsh').

By definition, INTERACTIVE is set "if the standard input is a tty and commands
are being read from standard input". In the above case standard input is not
tty and commands are not being read from standard input.

Well, I am concerned now how to prevent all definitions from .zshrc to be used
in subshell. I definitely do not want that (ls foo| ...) use my alias for ls;
and I do not want window title be mangled. Any idea? Is it possible to provide
"clean sandbox" for subshells?


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