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

Re: completion of path with double slashes



On Wed, Jan 26, 2022 at 10:02:37AM +0100, Pier Paolo Grassi wrote:
> Hello, I noticed that having a double slash in a path that I then try to
> complete, ie:
> 
> /home/paul//ab<TAB>
> 
> requires a significant more amount of time to execute than the same path
> without double slashes.
> I tried this with zsh -f, and it does not reproduce.
> Is there a setting that comes to mind that can be responsible for this?
> thanks
> 
> Pier Paolo Grassi

If you use compinit in your .zshrc, then // in a path will be treated as
/*/ when doing filename completion.

Look for "squeeze-slashes" in the zshcompsys(1) manual.

	squeeze-slashes
               If set to `true', sequences of slashes in filename paths
               (for example in `foo//bar') will be treated as a single
               slash.  This is the usual behaviour of UNIX paths.
               However, by default the file completion function behaves
               as if there were a `*' between the slashes.

-- 
Andreas (Kusalananda) Kähäri
SciLifeLab, NBIS, ICM
Uppsala University, Sweden

.




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