Cancel zsh tab completion

Zorawar

Is there a way to cancel a completion once it has been started? I sometimes foolishly press tab to autocomplete make targets (only from sheer indolence) and then end up having to wait for a longer time than if I had just typed the whole of "install" or "check" out myself.

I didn't see anything of note in the zshzle man page, but maybe I missed something? Do any other shells have this capability?

EDIT: Trivial answer. So instead: is there a way for zsh to estimate that tab completion would take a relatively long time to execute and instead ask whether the user would like this to be done?

Gilles 'SO- stop being evil'

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Cancel zsh tab completion

From Dev

Tab completion of "../" in zsh

From Dev

zsh tab completion on empty line

From Dev

Run command on tab completion in zsh

From Dev

zsh cd tab completion matching

From Dev

Git tab completion in zsh throwing errors

From Dev

disable cd tab completion for __pycache__ in zsh

From Dev

Combining zsh’s tab completion with case insensitivity

From Dev

zsh tab completion for ssh using IP Address

From Dev

Git tab completion not working in zsh on mac

From Dev

Zsh completion, enabling shift-tab

From Dev

Zsh, directory tab-completion with prefix

From Dev

Combining zsh’s tab completion with case insensitivity

From Dev

How to turn on tab completion in zsh/prezto?

From Dev

zsh: Tab completion for function with Git commands

From Dev

zsh completion: menu and unambiguous prefix with a single tab?

From Dev

Remove colors from zsh tab-completion

From Dev

Use colon as filename separator in zsh tab completion

From Dev

disable cd tab completion for __pycache__ in zsh

From Dev

define tab completion helper function to use in several completion files (zsh)

From Dev

Add strings to zsh tab completion for all commands and arguments

From Dev

How does one get tab-completion in gsettings from zsh?

From Dev

Setting up tab-completion of paths in bash or zsh to resemble tcsh

From Dev

zsh file tab completion: path preceded by non-space character

From Dev

zsh tab completion to run scripts in current folder (.<TAB>scr<TAB>)->./script.sh

From Dev

Cancel a completion block

From Dev

Can I navigate zsh's tab-completion menu with vi-like hjkl keys?

From Dev

When using zsh tab-completion, Ignore CDPATH if a local file or directory matches

From Dev

ZSH tab completion of git commands is very slow. How can I turn it off?

Related Related

  1. 1

    Cancel zsh tab completion

  2. 2

    Tab completion of "../" in zsh

  3. 3

    zsh tab completion on empty line

  4. 4

    Run command on tab completion in zsh

  5. 5

    zsh cd tab completion matching

  6. 6

    Git tab completion in zsh throwing errors

  7. 7

    disable cd tab completion for __pycache__ in zsh

  8. 8

    Combining zsh’s tab completion with case insensitivity

  9. 9

    zsh tab completion for ssh using IP Address

  10. 10

    Git tab completion not working in zsh on mac

  11. 11

    Zsh completion, enabling shift-tab

  12. 12

    Zsh, directory tab-completion with prefix

  13. 13

    Combining zsh’s tab completion with case insensitivity

  14. 14

    How to turn on tab completion in zsh/prezto?

  15. 15

    zsh: Tab completion for function with Git commands

  16. 16

    zsh completion: menu and unambiguous prefix with a single tab?

  17. 17

    Remove colors from zsh tab-completion

  18. 18

    Use colon as filename separator in zsh tab completion

  19. 19

    disable cd tab completion for __pycache__ in zsh

  20. 20

    define tab completion helper function to use in several completion files (zsh)

  21. 21

    Add strings to zsh tab completion for all commands and arguments

  22. 22

    How does one get tab-completion in gsettings from zsh?

  23. 23

    Setting up tab-completion of paths in bash or zsh to resemble tcsh

  24. 24

    zsh file tab completion: path preceded by non-space character

  25. 25

    zsh tab completion to run scripts in current folder (.<TAB>scr<TAB>)->./script.sh

  26. 26

    Cancel a completion block

  27. 27

    Can I navigate zsh's tab-completion menu with vi-like hjkl keys?

  28. 28

    When using zsh tab-completion, Ignore CDPATH if a local file or directory matches

  29. 29

    ZSH tab completion of git commands is very slow. How can I turn it off?

HotTag

Archive