How to leave the execute prompt in zsh
In a zsh, maybe I pressed Alt+X by mistake,
but now I'm stuck and this execute: _ prompt won't leave.
Pressing Ctrl+C does nothing. If I press Enter it tries to complete what I typed.
Pressing Enter on an empty line:
execute: _
zsh: do you wish to see all 373 possibilities (64 lines)?Typing q and pressing Enter:
execute: quote_
quoted-insert quote-line quote-regionIn other shells, Alt+X brings the same behavior, except that Ctrl+C cancels the prompt.
Is there a way to get out or is this shell dead?
53 Answers
Ctrl+G aborts the current editing command in Bash and Zsh if you are in Emacs mode (which is usually the default mode).
1I succeeded by trying Ctrl+ everything, to see the behavior.
When I pressed Ctrl+S, the terminal emulator told me that output was blocked. Then I pressed Ctrl+Q to enable output back, and my prompt came back to normal.
When I press Alt+X again, I have the same problem, but if I execute a zsh internal command it does it.
That's actually the current terminal / shell that doesn't receive Ctrl+C, I don't know why.
Edit from some time after (Oct 2017): It's probable that I had this bug due to a TRAP INT set up in my shell during some function and forgot to remove it.
ctrl + cis working for me, using
ctrl + gwill print
^gon my terminal 1