zsh-users
 help / color / mirror / code / Atom feed
* hashdirs in non-interactive shell
@ 2011-02-03 17:14 Nikolai Weibull
  2011-02-04 16:06 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Nikolai Weibull @ 2011-02-03 17:14 UTC (permalink / raw)
  To: Zsh Users

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: hashdirs in non-interactive shell
  2011-02-03 17:14 hashdirs in non-interactive shell Nikolai Weibull
@ 2011-02-04 16:06 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2011-02-04 16:06 UTC (permalink / raw)
  To: Zsh Users

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)));


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-05  7:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-03 17:14 hashdirs in non-interactive shell Nikolai Weibull
2011-02-04 16:06 ` Bart Schaefer

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).