Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Zsh's completion feature is great except for this one. When I try to complete in a folder with lots of files/network folder, it takes a couple of minutes and prints this error.

example.com:~$ ls /path/to/some/bigFolder/[TAB]
zsh: do you wish to see all 620 possibilities (124 lines)?

Instead Is there a way to specify a timeout after which zsh should not try to auto-complete? I am not able to cancel its search too.

share|improve this question
1  
+1 Great question. I'd be curious about the same in bash. –  rozcietrzewiacz Feb 22 '12 at 11:02

2 Answers 2

Ctrl-C should cancel the completion. If it doesn't, then there's little chance anything else would.

share|improve this answer

You can write a custom completer, implementing a timer/timeout, from the zsh FAQ, section 4
4.5: How do I get started with programmable completion?

Paraphrasing the FAQ

The main resource is the zshcompsys manual page.
... or copy one of the very many existing functions.

share|improve this answer
    
so I should re-write whole completion system for a timeout feature? Has anyone done that already? –  balki Feb 22 '12 at 14:35
    
not rewrite, customize. And, iff you cannot find "one of the very many existing functions" –  bdowning Feb 22 '12 at 17:07
    
how many files do you have in one directory? Are you calling compinit in your .zshrc file? –  bdowning Feb 22 '12 at 17:09
    
This answer would be useful if you showed how to customize the completion system to have a timeout. I don't see a relevant zstyle setting in the zshcompsys man page. In fact, I doubt it is possible: I don't think you can interrupt zsh while it's expanding a glob, which is what is blocking here. –  Gilles Feb 23 '12 at 2:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.