From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11398 invoked by alias); 8 Feb 2011 17:14:51 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28717 Received: (qmail 11359 invoked from network); 8 Feb 2011 17:14:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at klanderman.net does not designate permitted sender hosts) From: Greg Klanderman To: zsh-workers@zsh.org Subject: Re: loading user startup files for zsh scripts Reply-To: gak@klanderman.net Date: Tue, 08 Feb 2011 12:09:41 -0500 In-Reply-To: <110207213357.ZM22407@torch.brasslantern.com> (Bart Schaefer's message of "Mon, 07 Feb 2011 21:33:57 -0800") Message-ID: User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.17 (linux) References: <19792.22365.139876.599478@gargle.gargle.HOWL> <110207213357.ZM22407@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >>>>> On February 8, 2011 Bart Schaefer wrote: > The whole reason that ~/.zshenv exists is to contain commands that are > intended to be sourced by *every* zsh including scripts. This was a > deliberate design decision; if you don't want any such initialization > done, you can remove that file. The problem is that I create plenty of non-login & non-interactive shells in which I want to use my aliases and functions (for example those created by running commands from emacs) but those aliases and functions really shouldn't be seen by scripts my team creates at work. We can use '-f' in those scripts, but it is often overlooked, even by me, who knows better. I would much rather have to opt in to this behavior. Would it make sense to have another file sourced for all shells that are not running scripts? What's the best way to determine that the shell is running a script? Greg