Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Append cancelled commands to history
- X-seq: zsh-users 14962
- From: "Nadav Har'El" <nyh@xxxxxxxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Append cancelled commands to history
- Date: Wed, 24 Mar 2010 12:27:32 +0200
- Cc: zsh-users@xxxxxxx
- Hebrew-date: 9 Nisan 5770
- In-reply-to: <100322080712.ZM21793@xxxxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <c16a574a0809181450t61a5b5ddq2e80797fde37636e@xxxxxxxxxxxxxx> <20080919162045.GA22435@xxxxxxxxxxxx> <20090706151644.6BF508027106@xxxxxxxxxxxxxxxxxx> <20090706154309.GA15663@xxxxxxxxxxxxxxxxxxxxxxxxxx> <20090706155337.GB15663@xxxxxxxxxxxxxxxxxxxxxxxxxx> <20100315164237.GA23224@xxxxxxxxxxxxxxxxxxxxxxxxxx> <100320105027.ZM20067@xxxxxxxxxxxxxxxxxxxxxx> <20100322084226.GA26739@xxxxxxxxxxxxxxxxxxxxxxxxxx> <100322080712.ZM21793@xxxxxxxxxxxxxxxxxxxxxx>
On Mon, Mar 22, 2010, Bart Schaefer wrote about "Re: Append cancelled commands to history":
> On Mar 22, 10:42am, Nadav Har'El wrote:
> Something like this may work:
>...
Thanks! I wasn't aware of the zshaddhistory hook. Zsh has improved since
I last read its manual from cover to cover (circa 1995) :-)
Anyway, I tried what you wrote, and it didn't work because it appears the
zshaddhistory hook does not get called when I interrupt the ZLE.
But, further experimentation yielded that my problem is caused by something
either stranger:
Without any special hooks or trapint, if you try entering a multiline command
like
for i in 1 2 3
do
and then interrupt it, if you now go up in history you'll see this interrupted
command (but not the last line you interrupted on).
BUT, if you now run "history", you don't see this line! Even stranger, after
you run that "history" command and you try to go up, you no longer find this
history line.
So apparently, that interrupted multiline editing is *not* in the history,
and never was. So where is it? Why do I see it when I go "up" for the first
time? How do I prevent this? Again, I didn't find the relevant places in
the code :(
Thanks,
Nadav.
--
Nadav Har'El | Wednesday, Mar 24 2010, 9 Nisan 5770
nyh@xxxxxxxxxxxxxxxxxxx |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |I want to be a human being, not a human
http://nadav.harel.org.il |doing -- Scatman John
Messages sorted by:
Reverse Date,
Date,
Thread,
Author