On Mon, Dec 4, 2023 at 6:12 PM Vincent Lefevre wrote: > > zira% setopt CORRECT_ALL > zira% echo fil && true > zsh: correct 'fil' to 'file' [nyae]? > > Here, type Ctrl-C to interrupt. > > "echo fil" shouldn't have been put in the history. What's happening here is that the corrections occur in-place as the parser reads words from the input line, much the same way that aliases are expanded. When you hit ctrl-c you cause an interrupt signal which stops the parser from reading any further input, but because it's interactive the shell itself doesn't exit, it just forces the parser to return. The history mechanism then records what the parser read so far. Conversely when you hit e.g. 'a' the parser is not interrupted, continues to the end of the line, and then returns. Again the history mechanism records what the parser read so far. Changing this would potentially require changing the way the lexer+parser handle interrupt signals in general ... or changing both ^C and 'a' to skip the history, I suspect. > BTW, the behavior in case of several spelling corrections should > be documented. Something like this?