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

When you know completion will be slow ...



Completion functions that are going to perform potentially slow operations
(e.g., "git ls-files" is unpredictable on large repos, or the example from
recently on zsh-users of "system_profiler -listDataTypes") could warn the
user that there will be a delay.

The "zle -M" command works from inside a completion widget, and will erase
the completion listing (which is then redrawn), so it could be used to
display a message just before the long operation begins.  Unfortunately it
is not "safe to call" in the way that "zle -R" is, so may need to test that
zle is active with "zle && zle -M ..." ("zle -R" also works, but covers up
the first line of the completion listing which is then never redrawn).

This seems to interoperate safely with menu-selection as well.  If this is
deemed a good idea, we might want to document a standard zstyle name for it
so it can be turned on/off for properly written completion functions.



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