From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14812 invoked by alias); 3 Apr 2012 17:21:42 -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: X-Seq: 30382 Received: (qmail 21689 invoked from network); 3 Apr 2012 17:21:40 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120403102105.ZM11469@torch.brasslantern.com> Date: Tue, 03 Apr 2012 10:21:05 -0700 In-reply-to: <20120403143853.GI4925@xvii.vinc17.org> Comments: In reply to Vincent Lefevre "buggy completion for zsh [TAB]" (Apr 3, 4:38pm) References: <20120403143853.GI4925@xvii.vinc17.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: buggy completion for zsh [TAB] MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Apr 3, 4:38pm, Vincent Lefevre wrote: } } ypig% zsh [TAB] } shows all the files in the working directory. } } ypig% zsh foo[TAB] [shows files and commands beginning with "foo"] This is because _sh always falls through to _default when there are no arguments already on the command line, instead of taking the path where _alternative is called for files and commands which it does when there is at least one (partial) argument. } ypig% zsh foob[TAB] } foobar } } which is not expected when the completion is unique. } } [In] any case, following [TAB]'s have no effect. This seems to be happening because of the initial call to _arguments that is done by _sh only in the zsh case. This leaves the completion seeming to be "ambiguous". If I simply move the [[ $service == zsh ]] block to the end of _sh, things get a lot more sensible (but there's probably some state saving/returning that needs to be added as well). Also as it stands, after % zsh foobar [TAB] the options of zsh are completed even though they're no longer valid in that position. -- Barton E. Schaefer