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

No path completion on Cygwin mounts?



Hi, All, :)

My recent upgrade to a decent computer has made it feasible to try Zsh
again.  As I'm using Cygwin for my *nix environment, everything is
*much* slower than on a true *nix box, so my old PIII-700 laptop just
couldn't cut it.  The new 2.0GHz P4M laptop runs Zsh (with some
bells/whistles) reasonably well.

However, I'm having trouble getting pathname completion to work on
Cygwin mounts.  Here's my Cygwin mount table:

<snip>
64 12:27 ~
$ mount
C:\cygwin\usr\X11R6\lib\X11\fonts on /usr/X11R6/lib/X11/fonts type system (binmode)
C:\cygwin\bin on /usr/bin type user (binmode)
C:\cygwin\lib on /usr/lib type user (binmode)
C:\cygwin on / type user (binmode)
c: on /c type system (textmode)
h: on /h type system (binmode,noexec)
o: on /o type system (binmode,noexec)
q: on /q type system (binmode,noexec)
t: on /t type system (binmode,noexec)
v: on /v type system (binmode,noexec)
d: on /cygdrive/d type user (binmode,noumount)
m: on /cygdrive/m type user (binmode,noumount)
n: on /cygdrive/n type user (binmode,noumount)
p: on /cygdrive/p type user (binmode,noumount)
r: on /cygdrive/r type user (binmode,noumount)
w: on /cygdrive/w type user (binmode,noumount)
x: on /cygdrive/x type user (binmode,noumount)
y: on /cygdrive/y type user (binmode,noumount)
z: on /cygdrive/z type user (binmode,noumount)
</snip>

The problem comes when I try to complete a path on the mount point and
my CWD is on another mount.  For example:

<snip>
67 12:32 /h
$ pwd
/h

68 12:35 /h
$ cd /c/te<tab>
</snip>

Given my completion options, the <tab> *should* have completed to
'/c/temp/', because the C:\temp directory definitely exists.

The strange thing is that when I actually cd to the mount (so my CWD
is on the mount), then completion works fine.  This works as expected:

<snip>
72 12:37 /h
$ cd /c

73 12:37 /c
$ cd te<tab>

73 12:37 /c
$ cd temp

74 12:37 /c/temp
$
</snip>

(I mangled the screen capture a little bit on #73 to show the process
of <tab> completion.)

Does this make sense to anyone?  Any ideas why this might be
happening?

The only configuration settings I have are in /etc/zshenv, and here it
is:

<snip>
76 12:39 /etc
$ cat zshenv
# Called very first in the zsh startup process.

echo "This is /etc/zshenv"

export PS1='
%! %T %B%~%b
$ '

# Hack up the path.
export PATH="$(/usr/bin/perl ~/perl/fixpath3.pl)"

# Configure the zsh completion system.
autoload -U compinit
compinit

# Set some of my options.
setopt CDABLE_VARS
setopt AUTO_CD  # Like 4DOS 'cd' without 'cd'! - *yes*!!
setopt EXTENDED_GLOB  # Cool stuff.

# Make completion and file stuff insensitive.  Wow, I have no idea how
# this works.
zstyle ":completion:*" matcher-list 'm:{A-Za-z}={a-zA-Z}'

# Map backspace to 'erase' (backspace).
[[ "$TERM" == "xterm" || "$TERM" == "rxvt" ]] && stty erase '^?'

# Modify 'less' to be:
# -i: case insensitive unless search is for mixed case
# -F: Quit if less than one screen full.
# -M: use a prompt that has more detail about the file
# -X: don't reset the terminal before and after running.  This will
#     keep the last data displayed by less on the screen after quitting.
# -S: chop long lines so they don't wrap incessantly
# # 8: Change the horizontal scroll increment to be 8 columns
#alias less='less -iFMSX# 8'
export LESS="-iFMSX# 8"

# Called by zsh when the CWD is changed.  OLDPWD is the directory
# we're leaving.
chpwd() {
   if [[ ( $OLDPWD == /? ) || ( $OLDPWD == /?/* ) ]] then
      # Take the 2nd character
      drive=$OLDPWD[2]
      eval "p$drive=\"$OLDPWD\"";
   fi
}
</snip>

Thanks a lot for any help!

---Jason
St. Jude Medical



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