zsh-users
 help / color / mirror / code / Atom feed
* Problem with dir names containing spaces and parentheses
@ 2017-03-20 20:26 Jesper Nygårds
  2017-03-21  5:31 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Jesper Nygårds @ 2017-03-20 20:26 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 757 bytes --]

Suppose I have the following .zshrc:

# ===============================
autoload -U compinit; compinit

zstyle ':completion:*' path-completion false

mkdir -p /tmp/a\ \(test\)/{foo,bar}
# ===============================

If I type 'cd /tmp/a\ \(test\)/<tab>', I get no suggestions, although both
'foo' and 'bar' should be candidates. It seems that with this style set to
false, dir names with space and parentheses effectively blocks completions
for content under the problematic directory.

I get the same result with this zstyle instead of the previous one (or with
both together):

zstyle ':completion:*' accept-exact true

This style also makes it impossible to get completion below '/tmp/a\
\(test\)/'

Is it something else that need to be configured?

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

* Re: Problem with dir names containing spaces and parentheses
  2017-03-20 20:26 Problem with dir names containing spaces and parentheses Jesper Nygårds
@ 2017-03-21  5:31 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2017-03-21  5:31 UTC (permalink / raw)
  To: Zsh Users

This is another one where follow-ups probably ought to go to zsh-workers.

On Mar 20,  9:26pm, Jesper Nygards wrote:
} 
} zstyle ':completion:*' path-completion false

This takes the code branch in _path_files that has this comment:

    # Explanation of substitution: For tmp1 and tpre, which are used further
    # on, we need to remove quotes from everything that's not a pattern
    # character, because the code that does the file generation only
    # strips quotes from pattern characters (you know better than
    # to ask why).

A bit later this happens:

	# Now put donepath back the way it should be.  (I think.)
	donepath=${tmp3//(#b)([\\\]\[\^\~\(\)\#\*\?])/\\$match[1]}
	pre=$tpre

This fails to re-quote the space in $donepath and also sets $pre to
the empty string (i.e., $tpre is empty), which breaks any further file
matching in the directory (down around line 427 of _path-files, for
those attempting to follow the bouncing ball).  That's not the only
thing that's going on -- I'm beginning to thing $tmp3 isn't even the
right thing to be assigning to donepath at that point -- but that's
a hint of how tangled up this is.

} I get the same result with this zstyle instead of the previous one (or with
} both together):
} 
} zstyle ':completion:*' accept-exact true

Entirely different reason; here the "compfiles" builtin is failing.  I
am not going to attempt to delve into that.


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

end of thread, other threads:[~2017-03-21  5:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-20 20:26 Problem with dir names containing spaces and parentheses Jesper Nygårds
2017-03-21  5:31 ` 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).