Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG?] Accessing $userdirs (re)hashes all user dirs as named dirs
- X-seq: zsh-users 27415
- From: Marlon Richert <marlon.richert@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: [BUG?] Accessing $userdirs (re)hashes all user dirs as named dirs
- Date: Sun, 5 Dec 2021 21:39:23 +0200
- Archived-at: <https://zsh.org/users/27415>
- In-reply-to: <CAH+w=7YHcFtZc2NGOde2322eRh2r5sWNCutOfoXZJXfCmNL_nA@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAHLkEDv=EUbAJNzjyt_DS1DS=msUOESJVdy2kPiPUhKcoP0STA@mail.gmail.com> <CAH+w=7YHcFtZc2NGOde2322eRh2r5sWNCutOfoXZJXfCmNL_nA@mail.gmail.com>
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