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

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



On 2023-11-12 13:48, Roman Perepelitsa wrote:
tl;dr: zsh-no-ps2 changes the behavior of Enter key to insert a
newline instead of going into PS2
[...]

I remember offering something similar at https://unix.stackexchange.com/questions/750378/disabling-the-secondary-prompt-in-zsh/750481#750481 not so long ago (you might want to offer your plugin as an alternative answer there).

I agree that the inability to easily edit the previous line is quite annoying. Another problem with the PS2 prompt is that you cannot copy-paste the full command from your terminal.

That's one of the things fish does better than zsh IMO (though I'm not convinced by its indenting of continuation lines which also means the code cannot be copy-pasted).

Maybe that's something that could be implemented as a new widget in ZLE? An about (from Bart):

The drawback to skipping PS2 is that you don't get the helpful hints
about where you are in the syntax tree (by having %_ in the value of
PS2 or RPS2), but as Roman notes in his README.md, you can get back to
that by forcing an accept-line.

Another widget that returns the state of the parser after reading what's left of the cursor?

--
Stephane




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