Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: hashdirs in non-interactive shell
- X-seq: zsh-users 15770
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: hashdirs in non-interactive shell
- Date: Fri, 04 Feb 2011 08:06:40 -0800
- In-reply-to: <AANLkTin4=wW730zAtecJH6oZjBzHVCPf7zi4MEKHoFaU@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <AANLkTin4=wW730zAtecJH6oZjBzHVCPf7zi4MEKHoFaU@mail.gmail.com>
On Feb 3, 6:14pm, Nikolai Weibull wrote:
}
} Why is hashdirs on by default in a non-interactive shell? This option
} can increase start-up time quite a bit on systems were stat() isn't
} unnecessarily fast.
The short answer is that it's on by default because the state of most
options is determined only by what emulation mode is in effect, and
it didn't occur to anyone to make an exception of HASH_DIRS.
The longer answer is that there are so many options that we long ago
gave up trying to manage implicit dependencies among them, so there
are a large number of what might be considered nonsense combinations.
After considerable argument, the default set ended up being those
that seemed likely to be most attractive to a new interactive user.
Still, at the risk of descending onto the slippery slope, we could
handle this the way MONITOR is now handled. The slippery part is
that this likely applies to CORRECT, all the completion and history
options, and so on, and off we go ...
Index: init.c
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Src/init.c,v
retrieving revision 1.34
diff -c -r1.34 init.c
--- init.c 21 Dec 2010 16:41:16 -0000 1.34
+++ init.c 4 Feb 2011 15:55:49 -0000
@@ -243,6 +243,7 @@
* still 2 at the end, we set it to the value of INTERACTIVE.
*/
opts[MONITOR] = 2; /* may be unset in init_io() */
+ opts[HASHDIRS] = 2; /* same relationship to INTERACTIVE */
opts[SHINSTDIN] = 0;
opts[SINGLECOMMAND] = 0;
@@ -351,6 +352,8 @@
opts[INTERACTIVE] = !!opts[INTERACTIVE];
if (opts[MONITOR] == 2)
opts[MONITOR] = opts[INTERACTIVE];
+ if (opts[HASHDIRS] == 2)
+ opts[HASHDIRS] = opts[INTERACTIVE];
pparams = x = (char **) zshcalloc((countlinknodes(paramlist) + 1) *
sizeof(char *));
while ((*x++ = (char *)getlinknode(paramlist)));
Messages sorted by:
Reverse Date,
Date,
Thread,
Author