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

Re: ../ in PATH and completion



On Sep 29,  1:49am, Clint Adams wrote:
} Subject: ../ in PATH and completion
}
} A/1% PATH=/tmp/testdir
} A/2% fo<TAB>
} (will offer foobin as a completion, and hash it)
} 
} or
} 
} B/1% PATH=/tmp/otherdir/../testdir
} B/2% fo<TAB>
} (will not offer foobin, and not hash it)

This is caused by hashdirs() skipping directories for which isrelative()
returns true.  It's entirely possible that isrelative() should not return
true for /absolute/../rest; but as of this writing, it does.

} In contrast, bin_whence likes it just fine.

That's because bin_whence() calls findcmd(), which does a direct search
of the path without using hashdirs().  The completion system always uses
the hash tables, and is therefore at the mercy of the HASH_* setopts.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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