zsh completion doesn't work under Cygwin for other drives

2

I'm on Win7 x64, Cygwin 1.7 and zsh (and using oh-my-zsh). Zsh newbie here.

I've reviewed zsh autocompletion not working on cygwin and tried the solution there but no luck.

My mount table:

 C: on /c type ntfs (binary,posix=0,user,noumount,auto)
 D: on /d type ntfs (binary,posix=0,user,noumount,auto)
 F: on /f type ntfs (binary,posix=0,user,noumount,auto)

As you can see, I'm using /c, /d and /f for my drives. Part of the reason to change this from the default /cygdrive prefix is to maintain compat with Msysgit

Unfortunately after changing the drive prefix, zsh completion doesn't work

typing cd /f/code/Por<tab> no longer completes the folder or present options. It works fine in Bash though :(

If I cd into /f and then type cd Por - completion works.

How do I make it work everywhere?

Raghu

Posted 2013-01-12T10:19:43.487

Reputation: 123

Answers

1

This solution has the drawback of having to specify each and every drive, but it works for me:

zstyle ':completion:*' fake-files   '/:c' '/:d'

Alexander Groß

Posted 2013-01-12T10:19:43.487

Reputation: 156

2

Listing drives can be automated: https://github.com/agross/dotfiles/blob/master/cygwin/completion.zsh#L4

– Alexander Groß – 2017-06-08T13:18:25.747

Very very nice, thank you for sharing such a niche solution :) – Jorge Israel Peña – 2017-08-03T20:38:55.273

-1

I had a similar problem. If found out a solution: http://blog.en.edaro.net/2014/01/fix-broken-autocompletion-with-zsh-in.html

In my situation, the problem occurs only, when running cygwin as another user as you installed cygwin. And it may only occur, when this running user is an administrator (not tested with unprivileged user). The problem may be: As Administrator, you can "always" modify files, even if chmod disallows this. compinit does not know about this situation (its a unix app), but it finds out, that you have write acess to it - that's the problem.

Arakis

Posted 2013-01-12T10:19:43.487

Reputation: 3