Subject: Re: Aborted command saved in history
From: Mikael Magnusson <[email-masked]>
To: Bart Schaefer <[email-masked]>
Cc: zsh workers <[email-masked]>
Date: Thu, 28 Jan 2016 07:56:55 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Thu, Jan 28, 2016 at 6:45 AM, Bart Schaefer
<[email-masked]> 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