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 do 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-region

In 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?

  • 1
    Are you sure you get the prompt for showing all possibilities on Ctrl+C? Usually this should close the "execute:" prompt. I only get this prompt on Enter (on an empty line) and Escape. As far as I can see from the manpage, this is also seems to be not configurable. – Adaephon May 25 '16 at 23:45
  • I've got the same problem and I have an ominous feeling I have mapped the key to get out of this to something else – Robert Johnstone Oct 3 '17 at 14:38
  • @Sevenearths did you set any TRAP that you forgot to clear ? Your comment reminded me how I solved this bug (I think). – lolesque Oct 12 '17 at 22:23

Ctrl+g aborts the current editing command in Bash and Zsh if you are in Emacs mode (which is usually the default mode).

| improve this answer | |
  • Thanks for the answer. Small note... Ctrl+g seems to work in vi mode too. – Lqueryvg Mar 7 at 16:07

Wow I succeeded by trying Ctrl +everything, to see the behavior.

I pressed Ctrl + S, the terminal emulator told me that output was blocked, I pressed Ctrl + Q to enable output back, 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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