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

Re: Completion and double quotes



On Wed, 11 Aug 2010, Joke de Buhr wrote:

> Hi,
> 
> Currently my completion is somehow configured to transform double 
> quoted paths to backslash escaped paths.
> 
> Example:
>   ls /path/to/"file with"<TAB> -> /path/to/file\ with\ spaces
> 
> I would like the completion not to touch the quotation. But I can't 
> figure out how to get zsh to do this. The completion should work like 
> this.
> 
> Example:
>   ls /path/to/"file with"<TAB> -> /path/to/"file with spaces"
> 
> I don't remember what completion options caused the current behavior 
> but I remember having zsh configured to not touch the quotes.

Are you sure your above example worked before?  It's always bugged me a 
little (but not enough to search for it) that zsh leaves:

"/path/to/file with<Tab>
as a quoted string:
"/path/to/file with spaces"

but:
/path/to/"file with<Tab>
becomes toothpicked[1]:
/path/to/file\ with\ spaces

So, I'd also be interested to know what I'm overlooking.

A similar thing that bothers me is the way named directories are 
somewhat inconsistently expanded.  (From my perspective, that is.  It's 
probably entirely internally consistent.)  I can't come up with a 
minimal example right now, but I notice it most when trying to do things 
like:

for l in ~/bin/{*.pl,<Tab>

(That is: combinations of bracket expansion and file completion.)

Perhaps the cure(s) are the same or similar?  (Wouldn't be surprised if 
the latter weren't curable.)

-- 
Best,
Ben

[1] http://en.wikipedia.org/wiki/Leaning_toothpick_syndrome



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