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

Re: Some possible bugs...



On May 27,  8:44am, Sven Wischnowsky wrote:
} Subject: Re: Some possible bugs...
}
} > 	file-completion. Another problem is that if you
} > 	type:
} > 		ls "one<tab>"
} > 	and get:
} > 		ls "one two"
} > 	and then type the next couple of characters and
} > 	press tab again, like so:
} > 		ls "one two f<tab>"
} > 	no completion is done at all. 
} > 	Bash does this type of thing quite nicely. It might
} > 	be an idea to take a leaf from their book, so to
} > 	speak. 
} 
} The problem is that in things like `zsh -c "ls <TAB>' one doesn't want 
} the shell to treat the `"ls ' as one string. So when completing inside 
} quotes, zsh treats words separated by spaces as outside the quotes.

How hard would it be to make this context-sensitive?  For example, when
the effective compctl says to complete file names, treat the entire
quoted string as one word and attempt to complete it as a file (this is
what bash appears to do); similary for command names or anything else
that normally results in a single shell "word"; otherwise, complete the
way it's presently done.  This might require another compctl option,
similar to using	compctl -x ... -l '' ...	except that the
"range of command line words that are considered to be arguments" is a
single word that has to be split at IFS before completing.

So to get the current behavior you'd use something like (writing old style)

	compctl -x 'c[-1,-c]' -1 -l '' -- zsh

where I'm using -1 as this new option I've described for no better reason
than that I can't remember which (if any) letters are left for compctl.

This would also mean that, in the case where a single word such as a file
name is expected to result, zsh could automatically close the quotes and
append a space after the closing quote.

This so-called -1 option could apply to any other flag that followed it,
not just -l ... generically, it would mean "unquote and split the current
word, find a new current word after the split, then complete using the
following flags, and finally requote the result."

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



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