Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Zsh includes directories in tab completion
- X-seq: zsh-workers 43966
- From: dana <dana@xxxxxxx>
- To: "Saverio M." <saverio.pub2@xxxxxxxxx>
- Subject: Re: Zsh includes directories in tab completion
- Date: Wed, 2 Jan 2019 09:35:27 -0600
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=WQC9Mp5bTzFKxeZBh8caLMC2QZwlT7iGVukcEvnOGA4=; b=x0DvmHM1ACw9N69tgDiOMBmzAR8rpg0ZKNVLc/mSzRNDoE1svwrO69WYJX9QG9bPOq +OqllcDOZCB0NrLPPQDK7ghB4VtzXwNzI/AQdCbNvbpIJznuDWCWhJm8t/wKVXNcKowI O8w+sBdG+CXNR2njFgZMYvnpBY0fdf0RNpTgSoYc0erYK9EdgWxEIWnmLsdiVi7CXEJj a2UJ/oVjKiyMt3nIrGfGdlLPwLdipkapQiRG2goHIYXAwJOEIzZOtzO22f5HR30ix8rC hCNkBJ93uwEpuS24fdW2oYBiZefIol9s97t58511ptg4J+BQGF8tD6W+4vfL6KnG5i+9 1N1A==
- In-reply-to: <0fa50a79-556d-d7ab-8628-ab724bd46a07@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <0fa50a79-556d-d7ab-8628-ab724bd46a07@gmail.com>
On 2 Jan 2019, at 08:41, Saverio M. <saverio.pub2@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author