Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG?] Accessing $userdirs (re)hashes all user dirs as named dirs



 On Sun, Dec 5, 2021 at 7:45 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Sun, Dec 5, 2021 at 1:35 AM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> >
> > Almost none of these are dir names that I want or need. I don't think
> > this is desirable behavior. Is there a good reason for it to work this
> > way?
>
> $userdirs is literally nothing more than an API on the named
> directories hash table.

OK, but before $userdirs has been accessed, `hash -dL` outputs nothing
but the dirs I hashed myself. Normally, after doing `cd ~username`
exactly one entry is added to hash -dL's output. However, after
$userdirs has been accessed (as, for example, happens, when the
completion function _users has been called), the output is now
populated with ~120 usernames I don't want or need.

The same happens if I `hash -df`. Why would "rebuilding" this hash
table result in entries that weren't there in the first place? What is
the reasoning behind this?




Messages sorted by: Reverse Date, Date, Thread, Author