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

zsh-no-ps2: A plugin that inserts a newline on Enter instead of displaying PS2

tl;dr: zsh-no-ps2 changes the behavior of Enter key to insert a
newline instead of going into PS2

    git clone https://github.com/romkatv/zsh-no-ps2.git ~/zsh-no-ps2
    source ~/zsh-no-ps2/zsh-no-ps2.plugin.zsh

Normally, when you press Enter in zsh, one of two things happens: if
the currently typed command is complete, zsh attempts to execute it;
if it's incomplete, zsh displays the secondary prompt, also known as
PS2, to invite you to continue typing the command. I hate when zsh
goes into PS2 because to fix the command most of the time I need to
*edit what I've already typed*, which cannot be done. Those of you who
are using zsh4humans have been able to change this behavior so that
Enter inserts a newline if the typed command is incomplete. I've just
created a standalone plugin to make this feature available to
everybody: https://github.com/romkatv/zsh-no-ps2. No more PS2!

Also posted to r/zsh:


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