From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12221 invoked from network); 28 Mar 2001 21:58:58 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Mar 2001 21:58:58 -0000 Received: (qmail 8607 invoked by alias); 28 Mar 2001 21:58:49 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13823 Received: (qmail 8596 invoked from network); 28 Mar 2001 21:58:48 -0000 Date: Wed, 28 Mar 2001 14:03:06 -0800 (PST) From: Wayne Davison To: Sven Wischnowsky Cc: Subject: Re: Problem completing variables that contain spaces In-Reply-To: <200103281049.MAA10490@beta.informatik.hu-berlin.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 28 Mar 2001, Sven Wischnowsky wrote: > Wayne Davison wrote: > > I noticed that the new completion code in the latest zsh code is > > having trouble completing a variable that expands to a value that > > contains spaces. For instance, I was trying to complete $PWD in > > a directory path that contained a space: > > > > % mkdir 'two words' > > % chdir 'two words' > > % touch 1 2 > > % ls -l $PWD/ > > > > Instead of $PWD remaining unexpanded and starting menu completion, it > > expands to something strange like: > > > > $PWD/full/path/goes/here/two\ words/ > > I can't reproduce this. Can you try to make it do that starting with > -f and tell us the setup? The critical bit appears to be: zstyle ':completion:*' completer _expand _complete zstyle ':completion:*:expand:*' suffix false (Of course you need to call compinit and bindkey TAB to complete-word.) I can't remember why I set suffix to false, though. It was probably back during the time that I didn't want $VAR/* to expand the $VAR (or something like that). However, with this set: zstyle ':completion:*:expand:*' keep-prefix true the behavior of "suffix false" works exactly like "suffix true". Note that the keep-prefix line isn't required to duplicate the bug. In fact, you can tickle the bug without setting "suffix false" if you add a wildcard: % ls -l $PWD/* ..wayne..