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

Re: How to make ESC to cancel current completion

On Feb 21,  5:59pm, Sébastien Pierre wrote:
} % ls c/<ESC>      # I hit ESC to go back to where I was before hitting tab
} in the first place
} % ls              # typing ESC undo-ed the last 'c/' completion
} is there an option to make zsh behave like this ?

Are you using vi style bindings (bindkey -v) or emacs style (default)?

In emacs style, it should work to do

    bindkey '\e' send-break

but it's possible there are certain circumstances in which a local keymap
will fail to inherit that from the main keymap.

Note that you may also have to wait a fraction of a second after hitting
ESC before the binding kicks in, because there are many keys (such as
arrow and function keys) that send a sequence of characters beginning
with an ESC, and zsh has to wait to determine whether an ESC is meant to
stand on its own.

The default keystroke for this is ctrl+G, by the way.

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