How to leave the execute prompt in zsh

9,436

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

Share:
9,436

Related videos on Youtube

lolesque
Author by

lolesque

Autobiographer

Updated on September 18, 2022

Comments

  • lolesque
    lolesque over 1 year

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

    • Adaephon
      Adaephon almost 8 years
      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.
    • Robert Johnstone
      Robert Johnstone over 6 years
      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
    • lolesque
      lolesque over 6 years
      @Sevenearths did you set any TRAP that you forgot to clear ? Your comment reminded me how I solved this bug (I think).
    • ram
      ram over 3 years
      Does anyone know what this mode is called or how to actually use it?
    • Jim James
      Jim James over 3 years
      It's called execute-named-cmd, triggered by in : in normal mode if you're using vim bindings.
  • Lqueryvg
    Lqueryvg about 4 years
    Thanks for the answer. Small note... Ctrl+g seems to work in vi mode too.
  • Scott - Слава Україні
    Scott - Слава Україні over 3 years
    Are you willing to give your computer to lolesque (the OP)?  Because otherwise, telling what works on your computer isn’t any help to them, or to anybody else who has the same problem, inasmuch as the question says “Pressing Ctrl+C does nothing”.