Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Fix loading of multi-line history entires from disk
- X-seq: zsh-workers 32883
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Augie Fackler <raf@xxxxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Fix loading of multi-line history entires from disk
- Date: Thu, 17 Jul 2014 20:51:07 +0100
- In-reply-to: <20140717125841.GA27001@arthedain.local>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20140717125841.GA27001@arthedain.local>
On Thu, 17 Jul 2014 08:58:41 -0400
Augie Fackler <raf@xxxxxxxxxxx> wrote:
> Fixes the issue I posted about yesterday with
> history-incremental-search-backward. I have no idea as to the
> correctness of the fix, but my history file is written out in a way
> that matches 4.3.x with this patch applied, and the behavior matches
> again.
You're right, it does work in both cases.
The change that introduced this was to fix lines ending in two
backslashes. That presumably needs something more sophisticated. But
I'm not sure what --- the traditional doubling of backslashes to
indicate a continuation line isn't syntactically unique, so I don't see
how you can tell, short of checking for an extendedhistory introduction
on the next line if that option's set, and obviously there's no
guarantee it is.
Specifically, for a continuation line
% echo foo \
> bar \
> rod
I get
: 1405625973:0;echo foo \\
bar \\
rod
and for three separate lines
% echo foo \\
% echo bar \\
% echo rod \\
I get
: 1405626360:0;echo foo \\
: 1405626364:0;echo bar \\
: 1405626453:0;echo rod \\
So I think we're stuck without breaking backward compatibility.
Doubling all backslashes and looking for an odd number at the end would
have worked better.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author