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

Re: Completion in braces limitation



On Apr 28,  9:19am, Sven Wischnowsky wrote:
} Subject: Re: Completion in braces limitation
}
} > cd $(sw)/{<tab>
} > 
} > This expands $(sw) and quotes the brace. There may be a reason for doing
} > this but I can't think of one.
} 
} This is (again) intentional. To get rid of it, use complete-word
} instead of expand-or-complete.

Right; the "reason for it" is that you implicitly asked zsh to attempt
expansion before completion.

} I vaguely remember a discussion about this (several years ago), where, 
} if I remember correctly, most people said that one sometimes want to
} complete after a parameter expansion, but almost never after a command 
} substitution.

The problem with completing after a command substitution is that it has
to actually execute the command to figure out what to complete.  There's
no way to predict the side effects of executing the command multiple
times (at least twice -- once when completing and once when executing
the whole command line) so it's better to never start down the road.

Dunno if this is frequently-asked enough to be worthy of a FAQ entry ...

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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