zsh-users
 help / color / mirror / code / Atom feed
* Completions under NT / cygwin
@ 2001-03-15  3:32 Vin Shelton
  2001-03-15  6:20 ` Andrej Borsenkow
  2001-03-15 19:01 ` Oliver Kiddle
  0 siblings, 2 replies; 4+ messages in thread
From: Vin Shelton @ 2001-03-15  3:32 UTC (permalink / raw)
  To: zsh-users

At work I have built zsh from the latest CVS sources using the cygwin
toolkit.  When I use the new completion system, I can not complete
fully-qualified filenames, be they of the form "/cygdrive/d/views/..."
or (more conveniently) "d:/views/...".  Is there a magic style setting
I need to use to complete these filenames?

TIA,
  vin shelton


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Completions under NT / cygwin
  2001-03-15  3:32 Completions under NT / cygwin Vin Shelton
@ 2001-03-15  6:20 ` Andrej Borsenkow
  2001-03-15 19:01 ` Oliver Kiddle
  1 sibling, 0 replies; 4+ messages in thread
From: Andrej Borsenkow @ 2001-03-15  6:20 UTC (permalink / raw)
  To: Vin Shelton, zsh-users

>
>
> At work I have built zsh from the latest CVS sources using the cygwin
> toolkit.  When I use the new completion system, I can not complete
> fully-qualified filenames, be they of the form "/cygdrive/d/views/..."
> or (more conveniently) "d:/views/...".  Is there a magic style setting
> I need to use to complete these filenames?
>

For /cydrive use something like

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

See description of fake-files. You can add some magic to startup scripts to
find out what drives are actually available (and even get real cygdrive prefix
from registry).

For d:/ unfortunately now solution as for now. The rpoblem is, zsh does not
knwo that it is an absolute filename. The simplest solution wuld be to stick
cygpath in approptiate place in _path_files:

mw1g017@MW1G17C% cygpath -u d:/foo
/cygdrive/d/foo

This would imply that completion will replace d:/foo by it's unix name.

-andrej


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Completions under NT / cygwin
  2001-03-15  3:32 Completions under NT / cygwin Vin Shelton
  2001-03-15  6:20 ` Andrej Borsenkow
@ 2001-03-15 19:01 ` Oliver Kiddle
  2001-03-16  6:23   ` Andrej Borsenkow
  1 sibling, 1 reply; 4+ messages in thread
From: Oliver Kiddle @ 2001-03-15 19:01 UTC (permalink / raw)
  To: Vin Shelton, zsh-users

--- Vin Shelton <acs@alumni.princeton.edu> wrote:
> At work I have built zsh from the latest CVS sources using the cygwin
> toolkit.  When I use the new completion system, I can not complete
> fully-qualified filenames, be they of the form
> "/cygdrive/d/views/..."

An alternative to Andrej's suggestion which I have used is to use
something like:

for drive in a b c d k p r; hash -d $drive=/cygdrive/$drive

in .zshrc. Then you can refer to other drives with, for example ~c/
Completion after that works fine (unless it requires something else in
my setup).

For some reason if you omit the hash -d and just set the variable, i.e.
for d in a b c; $d=/cygdrive/$d
I get error messages like this:
/home/administrator/.zshrc:48: no such file or directory: r=/cygdrive/r
Note that this is a fairly old version of zsh so this might be fixed by
now - I only rarely use cygwin.

Oliver



____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Completions under NT / cygwin
  2001-03-15 19:01 ` Oliver Kiddle
@ 2001-03-16  6:23   ` Andrej Borsenkow
  0 siblings, 0 replies; 4+ messages in thread
From: Andrej Borsenkow @ 2001-03-16  6:23 UTC (permalink / raw)
  To: Oliver Kiddle, Vin Shelton, zsh-users

> An alternative to Andrej's suggestion which I have used is to use
> something like:
>
> for drive in a b c d k p r; hash -d $drive=/cygdrive/$drive
>
> in .zshrc. Then you can refer to other drives with, for example ~c/
> Completion after that works fine (unless it requires something else in
> my setup).
>
> For some reason if you omit the hash -d and just set the variable, i.e.
> for d in a b c; $d=/cygdrive/$d
> I get error messages like this:
> /home/administrator/.zshrc:48: no such file or directory: r=/cygdrive/r
> Note that this is a fairly old version of zsh so this might be fixed by
> now - I only rarely use cygwin.
>

I doubt that. /cygdrive/r is pure virtual "directory" which means, any normal
file operation on it fails. Zsh probably tries to stat it.

fake-files was invented exactly to allow /cygdrive/x completion under cygwin.
It works nicely. Note, that it will work in *any* context where filename is
expected.

-andrej


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-03-16  6:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-15  3:32 Completions under NT / cygwin Vin Shelton
2001-03-15  6:20 ` Andrej Borsenkow
2001-03-15 19:01 ` Oliver Kiddle
2001-03-16  6:23   ` Andrej Borsenkow

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).