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

Re: [BUG] With CORRECT_ALL, an interrupted correct puts a truncated entry in history



On Tue, Dec 5, 2023 at 4:57 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>
> I thought that this would have been put in a temporary buffer,
> until the (possibly corrected) command is validated.

I'm not sure what you think "validated" means here.

> I think that ^C and 'a' should just skip the history.

I'm not going to make a decision on that without further feedback.  I
know that when I use 'a' at the "correct" prompt, I often do
eventually want to go back and re-execute the command even if I wasn't
ready to 'e'dit it at the moment of the correction.

I did notice something that seems more like a bug:  If you 'a'bort a
correction at the PS2 prompt, you're returned to PS2, but then never
prompted for further corrections at subsequent PS2 prompts.  Meanwhile
'e'dit at PS2 does not leave the PS2 prompt but then pops the whole
complex command back into the editor after you finally reach the end
of it.  Another side-effect of handling it all during the parse.

> In particular, the current 'n' one is very ambiguous, because one may
> want to run the command without any additional prompt for corrections.
> So perhaps there should be a real
>
>     r (`run`)

Why would you want "discard all and run" but not "accept all and run"?
 Anyway I think that's more typically handled by distinguishing 'n'
/'N' and 'y'/'Y', although (see above) 'a' already discards all.




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