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

Re: Bug#749969: history no longer syncs immediately, INC_APPEND_HISTORY broken



Hi list,

Debian's BTS received a regression report for zsh.

I'll include a slightly shortened account of the bug-reporter's
findings. The version in "stable" he references is 4.3.17; the version
that shows the broken behaviour is 5.0.5 (and I suspect that releases
starting at 5.0.3 will contain the regression):

Peter Palfrader wrote:
[...]
> since upgrading from stable, I noticed that zsh no longer adds commands
> to the history immediately when they are started.  They only get added
> when they have finished.
>
> That's a regression from stable, where things got added as soon as they
> started.
>
> This is as important feature for me, as I often want to run similar
> (long running) commands at the same time.  I.e., I issue a command, open
> a new shell in a new terminal emulator window, slightly modify it and
> send it off.  Now that's no longer possible.
>
> E.g.:
>  - Run "sleep 10" in a zsh in your favorite terminal emulator.
>  - Open a second window.  "sleep 10" is not yet in your history.
>  - <wait 10 seconds>
>  - Open a third window.  "sleep 10" is now there.
>
> Ideally the sleep 10 would be there even in the second window.
[...]
> All I ask is that INC_APPEND_HISTORY again work as documented:
>
> | This  options  works like APPEND_HISTORY except that new history
> | lines are added to the $HISTFILE incrementally (as soon as  they
>                                                   ^^^^^^^^^^^^^^^^
> | are  entered)
>   ^^^^^^^^^^^^

I've skimmed through our version control history, and I'm pretty sure
the reason for this is 16ff79a885f aka workers-31789 aka ¹. And I agree
that it's a regression, that breaks long standing behaviour, which
affects at least the use case that Peter describes.

I think to enable both ways to be possible, there should be two options:
INC_APPEND_HISTORY that enables the original behaviour and (if the name
is agreeable) DELAY_INC_APPEND_HISTORY, that amends the behaviour of the
original option in the way that is reflected by the current behaviour.

If your first instinct is to suggest enabling SHARE_HISTORY, then please
note, that that's a rather intrusive option that can't possibly be
forced onto users that don't want it (I wouldn't want it, and the bug
reporter doesn't either).

CC:ing Han, who is the original author. PWS, who did some refinements on
top of Han's original code, reads all mails on -workers anyway. ;)


Regards, Frank

¹ http://www.zsh.org/mla/workers/2013/msg00824.html

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925



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