Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: newuser loaded for scripts
- X-seq: zsh-workers 22789
- From: "Vin Shelton" <acs@xxxxxxxxxxxxxxxxxxxx>
- To: "Peter Stephenson" <pws@xxxxxxx>
- Subject: Re: newuser loaded for scripts
- Date: Fri, 29 Sep 2006 13:56:57 -0400
- Cc: "zsh workers" <zsh-workers@xxxxxxxxxx>
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=TBCsRTmTF/gZm+UAErgRTlwOQU9Em5DbKJ+De0BRJCuaPu1MwqKgqEn0jD7HNTCeI/bz7xSAo0+0DsZGmF13RZJsFTQnYQHhtQaL7WBrW0aTSWD22vnYrkDmw2FWVnF1yAUnJL+SKK4qlJphjjS6lgWIkk9rYxfL4M7IhrWI8CY=
- In-reply-to: <200609280941.k8S9fjQn014225@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20060927203335.GC22780@xxxxxxxxxxxxxxx> <200609280941.k8S9fjQn014225@xxxxxxxxxxxxxx>
- Sender: ethersoft@xxxxxxxxx
Frank's fix seems to prevent scripts from sourcing ~/.zshenv. (I
think it's odd that none of the regression tests detected this.
Here's how I fixed this:
--- ChangeLog~ 2006-09-29 10:51:55.000000000 -0400
+++ ChangeLog 2006-09-29 13:43:41.803926416 -0400
@@ -1,3 +1,7 @@
+2006-09-29 Vin Shelton <acs@xxxxxxxxxx>
+
+ * Src/init.c: Source zshenv even if non-interactive.
+
2006-09-28 Peter Stephenson <pws@xxxxxxx>
* 22783: Frank Terbeck: Src/init.c: don't load zsh/newuser
--- ../zsh-2006-09-28/Src/init.c 2006-09-28 07:30:58.000000000 -0400
+++ Src/init.c 2006-09-29 13:37:40.252890528 -0400
@@ -958,15 +958,17 @@
source(GLOBAL_ZSHENV);
#endif
- if (isset(RCS) && isset(INTERACTIVE) && unset(PRIVILEGED))
+ if (isset(RCS) && unset(PRIVILEGED))
{
- /*
- * Always attempt to load the newuser module to perform
- * checks for new zsh users. Don't care if we can't load it.
- */
- if (load_module_silence("zsh/newuser", 1)) {
- /* Unload it immediately. */
- unload_named_module("zsh/newuser", "zsh", 1);
+ if (isset(INTERACTIVE)) {
+ /*
+ * Always attempt to load the newuser module to perform
+ * checks for new zsh users. Don't care if we can't load it.
+ */
+ if (load_module_silence("zsh/newuser", 1)) {
+ /* Unload it immediately. */
+ unload_named_module("zsh/newuser", "zsh", 1);
+ }
}
sourcehome(".zshenv");
- Vin
On 9/28/06, Peter Stephenson <pws@xxxxxxx> wrote:
Frank Terbeck wrote:
> Hi workers!
>
> Somebody who doesn't use zsh wondered, why the shell wants to
> configure itself, just because he wants to run a script that is
> written in zsh.
>
> Only loading the newuser module if the shell is interactive (which
> should be enough) would fix this. I'm not too familiar with the zsh
> code, but the change should be trivial.
The module's script is supposed to check if it should really be running
later on, keeping the tests here short, but this is a perfectly
reasonable restriction, so I'll add it. Thanks.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
--
Whoever you are, no matter how lonely,
the world offers itself to your imagination,
calls to you like the wild geese, harsh and exciting--
over and over announcing your place
in the family of things. Mary Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author