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

Re: command recall



On 2021-02-07 8:56 a.m., Bart Schaefer wrote:

... There are all sorts of reasons for
this, including being able to have a stable numbering scheme (keys in
the $history hash table) during computation of zle widgets.
I wondered how that worked.  With half a dozen open terminals, each of them accepting commands at various times, it's quite cool how they all end up in chronological order when merged.  I've tried all sorts of ways to break that but it refuses to be fooled.

That's because the order of operations is
1) You accept-line, so the pinocchio entry is ready to become a real boy
2) Consequently, the history gets merged
3) The "history" command executes
This is the tiniest of issues but I was just about to start experimenting with making
a widget, which I did once and it worked.  If you had:

....
accept-line
history-beginning-search-backward
....

would that work?  Probably some easy way to force the merge before the search, no?
Still it seems intuitive that this should happen anyway.







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