zsh-workers
 help / color / mirror / code / Atom feed
From: Greg Klanderman <gak@klanderman.net>
To: zsh-workers@zsh.org
Subject: Re: loading user startup files for zsh scripts
Date: Tue, 08 Feb 2011 12:09:41 -0500	[thread overview]
Message-ID: <m3ipwue9m2.fsf@klanderman.net> (raw)
In-Reply-To: <110207213357.ZM22407@torch.brasslantern.com> (Bart Schaefer's message of "Mon, 07 Feb 2011 21:33:57 -0800")

>>>>> On February 8, 2011 Bart Schaefer <schaefer@brasslantern.com> 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


  reply	other threads:[~2011-02-08 17:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-07 20:34 Greg Klanderman
2011-02-08  5:33 ` Bart Schaefer
2011-02-08 17:09   ` Greg Klanderman [this message]
2011-02-08 17:20     ` Peter Stephenson
2011-02-09  0:37       ` Greg Klanderman
2011-02-09  4:58         ` Bart Schaefer
2011-02-09 15:32           ` Greg Klanderman
2011-02-09 16:01           ` Greg Klanderman
2011-02-09 16:53             ` Bart Schaefer
2011-02-10 16:30               ` Greg Klanderman
2011-02-10 17:52                 ` Bart Schaefer
2011-02-10 23:10                   ` Greg Klanderman
2011-02-11  1:42                   ` Greg Klanderman
2011-02-11  3:29                     ` Bart Schaefer
2011-02-11 16:28                       ` Greg Klanderman
2011-02-11 17:26                         ` Bart Schaefer
2011-02-11 17:47                           ` Peter Stephenson
2011-02-11 18:36                           ` Bart Schaefer
2011-02-11 19:25                         ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ipwue9m2.fsf@klanderman.net \
    --to=gak@klanderman.net \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).