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

Re: [PATCH] enable elaped time with incappendhistory



On Fri, 11 Oct 2013 11:05:33 +0100
Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> I'm wondering if there's a neater way of doing this, but I think the
> answer is "not much neater, anyway".

May as well mention it before I go back to sleep...

Actually, I think we could split hend() in two.  The early part needs to
return a status indicating if it's OK to execute the line that's been
retrieved (remember the history mechanism sits on top of the input
mechanism, an unusual case of the shell obeying the standard rules of
hierarchy).  I don't think it actually needs to perform the save (or
sharehistory rewrite) at that point.  It would probably be safe to do
that later in loop().

The one thing this might get wrong is if you were using share_history
and expected to be able to retrieve a line you were still executing in
another window, i.e. corresponding to a command that takes a significant
time.  This sounds a plausible requirement.  Obviously it's entirely
incompatible with the requirement of getting the execution time for the
command correct.  (Well, unless you save the line twice using
the sharehistory editing mechanism, but this is getting silly.)

I don't actually intend to look further at this unless the current
situation proves impossible to handle.

pws



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