From: Leah Neukirchen <leah@vuxu.org>
To: zsh-workers@zsh.org
Subject: Re: _sh doing _normal completion
Date: Wed, 28 Mar 2018 15:46:32 +0200 [thread overview]
Message-ID: <87d0zoe2iv.fsf@gmail.com> (raw)
In-Reply-To: <20180327203314.6c6fbdde@ntlworld.com> (Peter Stephenson's message of "Tue, 27 Mar 2018 20:33:14 +0100")
Peter Stephenson <p.w.stephenson@ntlworld.com> writes:
> On Tue, 27 Mar 2018 15:34:12 +0200
> Leah Neukirchen <leah@vuxu.org> wrote:
>> the default _sh completion tries _files, then falls back to _normal.
>> However, sh, [t]csh and rc don't support this, and ksh/bash only
>> support it for actual shell scripts.
>>
>> So I wonder if this is a reasonable completion?
>
> Do you mean falling back to _normal isn't sensible, i.e. it's not worth
> assuming you can specify an executable command or similar after the file
> name, since it's unlikely the shell can handle it? It's not a particularly
> sophisticated fallback, certainly. It's possible you could think of a
> better way of searching for finding a script in the path, which I guess
> is the real intention. Until someone does, this is probably going to
> stay the best we've got.
The main problem is that it floods the reasonable expansions (from .)
with the full contents of $PATH.
As discussed in #zsh I now use:
zstyle ':completion:*:(sh|rc):*' tag-order '! commands builtins'
(POSIX /bin/sh may do a PATH lookup, but dash and OpenBSD sh don't.)
thx,
--
Leah Neukirchen <leah@vuxu.org> http://leah.zone
next prev parent reply other threads:[~2018-03-28 13:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-27 13:34 Leah Neukirchen
2018-03-27 19:33 ` Peter Stephenson
2018-03-28 13:46 ` Leah Neukirchen [this message]
2018-03-28 13:59 ` Stephane Chazelas
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=87d0zoe2iv.fsf@gmail.com \
--to=leah@vuxu.org \
--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).