zsh-workers
 help / color / mirror / code / Atom feed
* [BUG] With CORRECT_ALL, an interrupted correct puts a truncated entry in history
@ 2023-12-05  2:12 Vincent Lefevre
  2023-12-05  4:10 ` Bart Schaefer
  0 siblings, 1 reply; 11+ messages in thread
From: Vincent Lefevre @ 2023-12-05  2:12 UTC (permalink / raw)
  To: zsh-workers

Hi,

I was wondering why I got truncated entries in the history
over the past years...

Consider the following with zsh 5.9:

$ zsh -f
zira% touch file
zira% setopt CORRECT_ALL
zira% echo fil && true
zsh: correct 'fil' to 'file' [nyae]?

Here, type Ctrl-C to interrupt.

zira% history
    1  touch file
    2  setopt CORRECT_ALL
    3  echo fil

"echo fil" shouldn't have been put in the history.

Even when I just type "echo fil" instead of "echo fil && true",
this is incorrect. But with data after the word to correct, this
is even worse, as one gets an unexpected entry in the history.

When I type 'a' instead of Ctrl-C, the full command line is put
in the history. This is better, but I'm wondering whether this
behavior is correct. The man page just says (see SPROMPT):

    a (`abort')
        Discard the entire command line without running it.

Nothing about the history. I think that the history shouldn't be
changed. But in this case, a new action (e.g. 'h' for "history")
to discard the entire command line and put it in the history
could be useful in some occasions.

BTW, the behavior in case of several spelling corrections should
be documented.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-01-21  5:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05  2:12 [BUG] With CORRECT_ALL, an interrupted correct puts a truncated entry in history Vincent Lefevre
2023-12-05  4:10 ` Bart Schaefer
2023-12-05 12:57   ` Vincent Lefevre
2023-12-05 21:22     ` Bart Schaefer
2023-12-06 15:03       ` Vincent Lefevre
2023-12-09 21:44         ` Bart Schaefer
2023-12-17 13:54           ` Vincent Lefevre
2023-12-17 19:37             ` Bart Schaefer
2023-12-18  3:37               ` Vincent Lefevre
2023-12-18  6:36                 ` Bart Schaefer
2024-01-21  5:06     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).