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

Re: PATCH: Make subshells non-interactive



Peter Stephenson wrote:
"Simon 'corecode' Schubert" wrote:
I noticed that subshells of an interactive shell consider themself intera=
ctive as well.  I am not sure if this is desired, but making them non-int=
eractive helps to solve my real issue:

when executing

	zsh% (cd .)

my chpwd function is executed.  In a subshell, I want to avoid that.
Making the subshell be non-interactive and checking [[ -o interactive ]]
in my chpwd() does the trick, but maybe there is a better solution?

Could you not test one of the existing options which is reset, zle or
monitor?

ah well, yes of course.  it just seemed odd that a subshell which is not reading commands from stdin will be interactive.

For example, (pushd) will print the dirstack.  On the other hand, (fc) will output the recent history, without being interactive it is unhappy, but I don't see much reason calling fc from a subshell.

cheers
 simon

--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \

Attachment: signature.asc
Description: OpenPGP digital signature



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