Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
truncated alternate history
- X-seq: zsh-workers 28079
- From: Pavol Juhas <pj2192@xxxxxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: truncated alternate history
- Date: Thu, 15 Jul 2010 11:21:48 -0400
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh workers <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author