Cancel zsh tab completion

A SIGINT interrupts the current completion operation and brings you back to the line editor. So press Ctrl+C. The effect might not be immediate: the interpreter only checks for signals at certain points during execution (they're frequent, though), and the signal might take a while if the zsh process is blocked in a system call (for example, if it's waiting for a filesystem to respond).

Unfortunately, if you press Ctrl+C at the wrong time and there is no completion in progress by the time the signal is delivered, your current command line will be canceled. This is difficult to fix without having two different interrupt keys, one for completion and one for the rest, and I'm not sure if zsh supports this.

It's not really feasible to warn you if a completion might take a long time. The speed of a completion function is often mainly driven by the speed at which some information can be read from the filesystem; whether this information is in cache or not, how much there is, and what kind of a filesystem it is (e.g. ramdisk, hard disk or NFS mount) has a lot of influence.

You could use ctrl+k to cancel the auto-completion. however i can not find any information from zsh guide either, but it does cancel auto-completion.