From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28597 invoked by alias); 28 Mar 2018 13:47:06 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42555 Received: (qmail 15843 invoked by uid 1010); 28 Mar 2018 13:47:06 -0000 X-Qmail-Scanner-Diagnostics: from 195.159.176.226 by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(195.159.176.226):SA:0(-0.8/5.0):. Processed in 15.085504 secs); 28 Mar 2018 13:47:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RDNS_NONE,T_SPF_TEMPERROR autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: gcszd-zsh-workers@m.gmane.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Leah Neukirchen Subject: Re: _sh doing _normal completion Date: Wed, 28 Mar 2018 15:46:32 +0200 Message-ID: <87d0zoe2iv.fsf@gmail.com> References: <87sh8lfxrf.fsf@gmail.com> <20180327203314.6c6fbdde@ntlworld.com> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@blaine.gmane.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) In-Reply-To: <20180327203314.6c6fbdde@ntlworld.com> (Peter Stephenson's message of "Tue, 27 Mar 2018 20:33:14 +0100") Peter Stephenson writes: > On Tue, 27 Mar 2018 15:34:12 +0200 > Leah Neukirchen 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 http://leah.zone