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



Coming back to this because of the unfinished documentation patch.

On Tue, Dec 5, 2023 at 4:57 AM Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>
> I was also thinking about the SPROMPT documentation. The following
> is inexact:
>
>     n (`no') (default)
>         Discard the correction and run the command.
>     y (`yes')
>         Make the correction and run the command.

After thinking about this for bit, I realized that the foregoing was
written specifically for the CORRECT option and was never made to
reflect CORRECT_ALL.

> One may think that the command will be run immediately after 'n' or 'y'
> (i.e. not checking for other corrections).

That's exactly what does happen with CORRECT.  So this --

>     Discard/Make the correction and prompt for the next correction
>     or run the command.

-- isn't right either, unless CORRECT_ALL is set.
diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
index 68df4a16f..a6fbe6723 100644
--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -1635,9 +1635,13 @@ All other prompt escapes are also allowed.
 
 The actions available at the prompt are tt([nyae]):
 startsitem()
-sitem(tt(n) +LPAR()`no'+RPAR() +LPAR()default+RPAR())(Discard the correction and run the command.)
-sitem(tt(y) +LPAR()`yes'+RPAR())(Make the correction and run the command.)
-sitem(tt(a) +LPAR()`abort'+RPAR())(Discard the entire command line without running it.)
+sitem(tt(n) +LPAR()`no'+RPAR() +LPAR()default+RPAR())(Discard the correction.
+If there are no more corrections, accept the command line, else (with
+tt(CORRECT_ALL)) prompt for the next.)
+sitem(tt(y) +LPAR()`yes'+RPAR())(Make the correction. If there are no more
+corrections, accept the command line.)
+sitem(tt(a) +LPAR()`abort'+RPAR())(Place the entire command line in the
+history for later edit, but without accepting it.)
 sitem(tt(e) +LPAR()`edit'+RPAR())(Resume editing the command line.)
 endsitem()
 )


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