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

Re: Aborted command saved in history



On Thu, Jan 28, 2016 at 6:45 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jan 28,  2:06am, Mikael Magnusson wrote:
> }
> } If i type
> }  {<enter>
> } and press ctrl-c, the " {" is saved in my history file without
> } consulting zshaddhistory()
>
> zshaddhistory is consulted, it just immediately returns without doing
> anything because the error condition from the keyboard interrupt is
> still persisting.

Ah, I only checked with an echo. Is it expected that the line is saved
at all though? If you do a get-line and then ctrl-c twice, it is not
saved, so a possible argument that "you accepted the first part of the
line when you pressed enter" seems a bit weak to me.

Usually when I get a continuation prompt it's because I mistyped
something, so I press ctrl-c to get out of the continuation and then
retrieve it with uparrow and try again. Saving all these mistakes in
the history doesn't seem useful, and I don't see any reasonable way
that zshaddhistory would be able to tell that it was a continuation
line?

-- 
Mikael Magnusson



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