From: dana <dana@dana.is>
To: "Saverio M." <saverio.pub2@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: Zsh includes directories in tab completion
Date: Wed, 2 Jan 2019 09:35:27 -0600 [thread overview]
Message-ID: <F7660FD6-2C11-4FC0-9ACB-CF12B05E9766@dana.is> (raw)
In-Reply-To: <0fa50a79-556d-d7ab-8628-ab724bd46a07@gmail.com>
On 2 Jan 2019, at 08:41, Saverio M. <saverio.pub2@gmail.com> wrote:
>On my system, zsh tab-completion includes directories present in the path, in
>addition to files, which is confusing and error prone.
>
>Is this intended?
Yes, by default the shell doesn't check the types of files it finds in your
PATH, it just hashes them all. You can enable the option hash_executables_only
to change that:
HASH_EXECUTABLES_ONLY
When hashing commands because of HASH_CMDS, check that the file to be hashed
is actually an executable. This option is unset by default as if the path
contains a large number of commands, or consists of many remote files, the
additional tests can take a long time. Trial and error is needed to show if
this option is beneficial.
It makes hashing slower in general, but like it says you'll have to see if
that's bothersome for you.
If you'd rather not do that, and it's only a problem for a few specific files,
you might be able to use the ignored-patterns style instead:
zstyle ':completion:*:commands' ignored-patterns myscript
dana
next prev parent reply other threads:[~2019-01-02 15:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-02 14:41 Saverio M.
2019-01-02 15:35 ` dana [this message]
2019-01-02 15:42 ` Daniel Shahaf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F7660FD6-2C11-4FC0-9ACB-CF12B05E9766@dana.is \
--to=dana@dana.is \
--cc=saverio.pub2@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).