zsh-workers
 help / color / mirror / code / Atom feed
* $userdirs empty in non-interactive shells
@ 2017-12-07 11:29 Stephane Chazelas
  2017-12-07 13:43 ` Stephane Chazelas
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Stephane Chazelas @ 2017-12-07 11:29 UTC (permalink / raw)
  To: Zsh hackers list

Hi,

$userdirs seems to only work in interactive shells. That seems
to be due to:

> mod_export void
> adduserdir(char *s, char *t, int flags, int always)
> {
>     Nameddir nd;
>     char *eptr;
>
>     /* We don't maintain a hash table in non-interactive shells. */
>     if (!interact)
>         return;

Why? It seems to me it would make as much sense to hash it in
non-interactive shells. It may be useful to be able to flush
that cache though.

Note that upon expanding $userdirs in non-interactive shells,
the code still loops over the pw entries.

So, if we don't want to change the behaviour, we may still want
to disable $userdirs altogether in non-interactive shells (and
update the documentation).

-- 
Stephane


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

end of thread, other threads:[~2018-06-17 14:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-07 11:29 $userdirs empty in non-interactive shells Stephane Chazelas
2017-12-07 13:43 ` Stephane Chazelas
2017-12-08 12:23 ` Stephane Chazelas
2017-12-08 12:31   ` Peter Stephenson
2017-12-08 19:46     ` Stephane Chazelas
2018-06-17 14:14 ` Stephane Chazelas

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