zsh-users
 help / color / mirror / code / Atom feed
* How to turn off Mac OS X Network share completion?
@ 2011-10-18  7:31 Gabriel Gilder
  2011-10-19  0:53 ` Gabriel Gilder
  2011-10-19  2:33 ` Bart Schaefer
  0 siblings, 2 replies; 4+ messages in thread
From: Gabriel Gilder @ 2011-10-18  7:31 UTC (permalink / raw)
  To: zsh-users

Hi there,

I've just switched to zsh from bash so apologies if this is a total newbie question. I've searched the list and done quite a bit of Googling but couldn't find a solution.

I'm often on a VPN for my company, and when I'm on the VPN a number of servers appear in Mac OS X's "/Network/Servers" path. The problem is that zsh tries to complete across these directories, so when I type, for instance, "cd adam<TAB>", the shell freezes up for about a minute while it searches across the network, and then I get a menu of usernames like so:

adam0        adam1     adam2     adam3        adam4       adam5   

(Actual names redacted.)

Then if I run "cd adam0" I'm taken to something like "/Network/Servers/example.com/Volumes/misc/adam0".

This seems to be the default behavior if I have these lines in my .zshrc:

autoload -U compinit
compinit

Is there a flag to turn off this type of completion across network shares?

Thanks in advance for any pointers,

-Gabriel



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

* Re: How to turn off Mac OS X Network share completion?
  2011-10-18  7:31 How to turn off Mac OS X Network share completion? Gabriel Gilder
@ 2011-10-19  0:53 ` Gabriel Gilder
  2011-10-19  6:33   ` Bart Schaefer
  2011-10-19  2:33 ` Bart Schaefer
  1 sibling, 1 reply; 4+ messages in thread
From: Gabriel Gilder @ 2011-10-19  0:53 UTC (permalink / raw)
  To: zsh-users

After a lot of banging my head against the wall, I figured out my problem, so I figured I'd post it here for anyone experiencing similar issues.

I included this line in my configuration:

zstyle ':completion:*' users ''

And now, mercifully, no user directories are used for completion. Whew!

-Gabriel


On Oct 18, 2011, at 12:31 AM, Gabriel Gilder wrote:

> Hi there,
> 
> I've just switched to zsh from bash so apologies if this is a total newbie question. I've searched the list and done quite a bit of Googling but couldn't find a solution.
> 
> I'm often on a VPN for my company, and when I'm on the VPN a number of servers appear in Mac OS X's "/Network/Servers" path. The problem is that zsh tries to complete across these directories, so when I type, for instance, "cd adam<TAB>", the shell freezes up for about a minute while it searches across the network, and then I get a menu of usernames like so:
> 
> adam0        adam1     adam2     adam3        adam4       adam5   
> 
> (Actual names redacted.)
> 
> Then if I run "cd adam0" I'm taken to something like "/Network/Servers/example.com/Volumes/misc/adam0".
> 
> This seems to be the default behavior if I have these lines in my .zshrc:
> 
> autoload -U compinit
> compinit
> 
> Is there a flag to turn off this type of completion across network shares?
> 
> Thanks in advance for any pointers,
> 
> -Gabriel
> 
> 


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

* Re: How to turn off Mac OS X Network share completion?
  2011-10-18  7:31 How to turn off Mac OS X Network share completion? Gabriel Gilder
  2011-10-19  0:53 ` Gabriel Gilder
@ 2011-10-19  2:33 ` Bart Schaefer
  1 sibling, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2011-10-19  2:33 UTC (permalink / raw)
  To: zsh-users

On Oct 18, 12:31am, Gabriel Gilder wrote:
}
} I'm often on a VPN for my company, and when I'm on the VPN a number
} of servers appear in Mac OS X's "/Network/Servers" path. The problem
} is that zsh tries to complete across these directories

What's the value of $PWD at the time you try this?  If you're not
already cd'd into /Network/Servers, "cd" shouldn't be completing
those servers ... so the next thing to check is whether some
helpful sysadmin has added /Network/Servers to everyone's $cdpath
(or did you perhaps add that yourself?).

Otherwise I don't know why "cd" would be looking anywhere outside your
current directory for completions.

} Then if I run "cd adam0" I'm taken to something like
} "/Network/Servers/example.com/Volumes/misc/adam0".

Yeah, it sure appears that someone has futzed with $cdpath for whatever
reason.

} Is there a flag to turn off this type of completion across network shares?

Not precisely, because zsh normally generates the possible matching
files and then prunes that set down to those that are desired, so
even using the ignored-patterns file won't keep zsh from searching
for the names in order to ignore them.

There might be something that can be done with the "fake" style but
usually it's for the opposite case, forcing a network share to seem
to be available when it isn't yet.

You need to find out why those paths are being considered in the first
place.


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

* Re: How to turn off Mac OS X Network share completion?
  2011-10-19  0:53 ` Gabriel Gilder
@ 2011-10-19  6:33   ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2011-10-19  6:33 UTC (permalink / raw)
  To: zsh-users

On Oct 18,  5:53pm, Gabriel Gilder wrote:
}
} I included this line in my configuration:
} 
} zstyle ':completion:*' users ''
} 
} And now, mercifully, no user directories are used for completion. Whew!

I'm glad that helped, but it doesn't explain why user names were being
completed for "cd" in the first place.

However, the answer has to be that the CDABLE_VARS option is set:

CDABLE_VARS (-T)
     If the argument to a cd command (or an implied cd with the AUTO_CD
     option set) is not a directory, and does not begin with a slash,
     try to expand the expression as if it were preceded by a `~' (see
     *Note Filename Expansion::).

I never use that, so I didn't recognize/recall that it will attempt to
complete user home directory names.

You may want to consider making the context for that zstyle more specific,
e.g.

	zstyle -a :completion::complete:cd::users ''

so that you can still get user names completed in other situations.


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

end of thread, other threads:[~2011-10-19  6:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-18  7:31 How to turn off Mac OS X Network share completion? Gabriel Gilder
2011-10-19  0:53 ` Gabriel Gilder
2011-10-19  6:33   ` Bart Schaefer
2011-10-19  2:33 ` Bart Schaefer

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).