Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: history-incremental-search-backward weird behavior for multiline commands in 5.0.x
- X-seq: zsh-workers 32871
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: history-incremental-search-backward weird behavior for multiline commands in 5.0.x
- Date: Wed, 16 Jul 2014 09:10:07 -0700
- In-reply-to: <CAPLqtWJr3LtGiqEioH0E-wje7VZi-yE6wCwkr2=r=+BK1RAoqQ@mail.gmail.com>
- 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: <CAPLqtWJr3LtGiqEioH0E-wje7VZi-yE6wCwkr2=r=+BK1RAoqQ@mail.gmail.com>
On Jul 16, 8:48am, Augie Fackler wrote:
}
} $ echo foo \
} > bar
} foo bar
} $ ^R bar
} # finds the full command
}
} but then in a new shell:
} $ ^R bar
} # finds only the word bar, not the full echo command.
Hmm, it looks like history loading may be mis-handling the case of an
INTENTIONAL backslash-newline pair. This gets stored in the history
file as e.g.
echo foo \\
bar
This is then re-loaded as the two lines
echo foo \\
(note the backslash is still doubled, though it was not when it was
originally input) and
bar
which obviously is wrong. I'm not sure whether the fix is to store
it with three backslashes, or to parse it differently on load, or both.
By contrast, if you had used quotes or a multi-line loop construct, each
line would have ended with a single backslash which is reloaded correctly.
} Am I missing something obvious? setopt hist_lex_words didn't make a
} difference, and I tried turning off hist_save_no_dups and
} inc_append_history.
hist_lex_words would need to be set very early, i.e., before the history
is loaded, in order to make any difference, but in this case it doesn't
matter.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author