Zsh Mailing List Archive
Messages sorted by:
Re: zsh sometimes freezes when completing a command
- X-seq: zsh-users 14946
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: zsh sometimes freezes when completing a command
- Date: Tue, 16 Mar 2010 06:58:10 -0700
- In-reply-to: <alpine.LNX.2.01.1003160115050.31893@xxxxxxxxxxx>
- List-help: <mailto:email@example.com>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20100315101546.GA28047@xxxxxxxxxxxxxxxxxxx> <100315085820.ZM6723@xxxxxxxxxxxxxxxxxxxxxx> <20100316001319.GC1761@xxxxxxxxxxxxxxxxxxx> <100315185415.ZM7280@xxxxxxxxxxxxxxxxxxxxxx> <20100316035049.GD1761@xxxxxxxxxxxxxxxxxxx> <alpine.LNX.2.01.1003160115050.31893@xxxxxxxxxxx>
On Mar 16, 1:35am, Benjamin R. Haskell wrote:
} From a similar discussion w/ subject: 'Avoid LDAP hit during
} completion', Peter's suggestion lead me tangentially to this section,
} from somewhere in zshall (zstyle(?) .. Standard styles):
} users This may be set to a list of usernames to be completed. If it
} is not set all usernames will be completed. Note that if it is
} set only that list of users will be completed; this is because
} on some systems querying all users can take a prohibitive amount
} of time.
Hmm, ramifications of this that didn't sink in before have just occurred
to me. One can set the style with "zstyle -e" to cause an eval at the
time of lookup, and therefore control the mechanism by which user lookup
is peformed (use an external app for LDAP, for example).
I don't have a clever example to offer just now, but food for thought.
} As pws explained in much more detail in that thread, that might not be
} the only place users would be generated. But, things also may have been
} cleaned up since 2005.
Users are generated by expanding a reference to the "userdirs" variable
defined in the zsh/parameter module. This happens in these locations:
_users in which case the zstyle suppresses the userdirs reference;
_expand when expanding any word that begins with tilde;
_chown when completing the user to whom to assign ownership;
_mailboxes when completing abbreviated mailbox names for mush or zmail;
_tilde_files when completing ~someuser/somepath...
Plus any completion loaded via the bashcompinit compatibility package
that runs "compgen -A users".
The _tilde_files case is interesting because if completing ~someuser
(without the trailing path) it calls _users and obeys the style. The
userdirs reference with the trailing path is always $userdirs[$user]
to confirm that user home directory exists, so perhaps that doesn't
trigger an expensive lookup or a large result set.
Messages sorted by: