Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Directory completion acts as if CHASE_LINKS is set



On Fri, 06 Sep 2013 22:03:00 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sep 6,  9:09pm, Peter Stephenson wrote:
> } Subject: Re: Directory completion acts as if CHASE_LINKS is set
> }
> } On Thu, 05 Sep 2013 08:31:39 -0700
> } Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> } > +    # Use cd in a subshell to properly [not] resolve symlinks
> } > +    tmpprefix=$(cd $PREFIX >&/dev/null && print $PWD) ||
> } > +      tmpprefix=$(cd $PREFIX:h >&/dev/null && print $PWD/$PREFIX:t)
> 
> } I also wonder if it would be better only to look at previous
> } directory components, i.e. always take the PREFIX up to the last "/"
> } (and require that there be one) rather than have two cases.
> 
> You'll have to actually write out what you mean here, because I can't
> get it to work for e.g. "cd ../" without having the first case there.

I'm thinking of something like ${PREFIX%/*}.

pws



Messages sorted by: Reverse Date, Date, Thread, Author