Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: history-beginning-local function
- X-seq: zsh-users 13032
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: "Zsh users list" <zsh-users@xxxxxxxxxx>
- Subject: Re: history-beginning-local function
- Date: Mon, 14 Jul 2008 13:44:28 -0700
- In-reply-to: <1186.1216057340@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <1186.1216057340@xxxxxxx>
On Mon, Jul 14, 2008 at 10:42 AM, Peter Stephenson <pws@xxxxxxx> wrote:
> This function allows you to have a local history file [...]
>
> The main problem is that you have to create and update the local history
> file yourself since commands aren't saved to it.
One possibility would be to put something in chpwd that remembers the
history number upon entering a directory and, upon leaving it, appends
the higher-numbered history entries to the local file.
Another approach might be to have chpwd change the global HISTFILE.
Then use inc_append_history so that commands in each directory are
appended as you go. That leaves just the problem of trapping shell
exit and writing the full history to the original HISTFILE (assuming
that's still desirable).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author