zsh-workers
 help / color / mirror / code / Atom feed
* truncated alternate history
@ 2010-07-15 15:21 Pavol Juhas
  0 siblings, 0 replies; only message in thread
From: Pavol Juhas @ 2010-07-15 15:21 UTC (permalink / raw)
  To: zsh workers

Hello,

I found some odd behavior when using local history in zsh 4.3.10 -
the alternate history file seems to be loaded only up to the
global history number:

    $ yes | head -7000 > ~/longhistory
    $ historylength() { fc -p -a ~/longhistory 7000; fc -l 1 -1 | wc -l }
    $ historylength	# global history number is 4004
    4003                # expected 7000

The behavior seems to be correct if the history push/pop commands
are on separate lines:

    $ fc -p ~/longhistory 7000
    $ fc -l 1 -1 | wc -l
    6999
    $ fc -P
    # global history number is 4006

but fails when all commands are on the same line:

    $ fc -p ~/longhistory 7000;  fc -l 1 -1 | wc -l;  fc -P
    4005
    
Would it be possible to fix this?

On a side note - I have used this feature in a "scd" function that
allows to quickly search and change among recently visited directories.
The script installs a chpwd hook that pushes all visited directories
to the .scdhistory file; the recently visited directories are returned
at a top of the matchlist.

If there is any interest, I would be glad to post / contribute this script.

Thanks,

Pavol


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-15 15:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-15 15:21 truncated alternate history Pavol Juhas

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).