Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: sync history between sessions without entering 'history' command
- X-seq: zsh-users 13891
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Re: sync history between sessions without entering 'history' command
- Date: Mon, 9 Mar 2009 11:16:42 -0400 (EDT)
- In-reply-to: <291b78b50903090721u271902e8w2da05c2aed6c6899@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <291b78b50903090622t79a78e26o870f5a848e65020c@xxxxxxxxxxxxxx> <20090309133336.GF27602@xxxxxxxxxxxxxxxxxxxx> <291b78b50903090721u271902e8w2da05c2aed6c6899@xxxxxxxxxxxxxx>
On Mon, 9 Mar 2009, Ye, Jianye wrote:
> 2009/3/9 Angel Olivera <redondos@xxxxxxxxxxx>
>
> > On Mon 09.Mar.09 21:22, Ye, Jianye wrote:
> >
> > > My .zshrc
> > > ----------------------------------------------------------------------
> > > setopt INC_APPEND_HISTORY SHARE_HISTORY setopt APPEND_HISTORY setopt
> > > EXTENDED_HISTORY HISTFILE=$HOME/.zhistory HISTSIZE=1000 SAVEHIST=1000
> > > ---------------------------------------------------------------------- When
> > > I have multiple sessions opened, each session could only see its local
> > > history until I enter 'history' or 'fc -R' command in any session. So, I
> > > need enter 'fc -R' from time to time to sync-up history. It's quite
> > > annoying. Any way to make history sync happen automatically ?
> > >
> >
> > Aren't INC_APPEND_HISTORY and APPEND_HISTORY mutually exclusive? Try
> > commenting out the latter.
> >
> > --
>
>
> I've commented out 'append_history'. But still the same.
>
From the documentation, it sounds like SHARE_HISTORY is the option you
want. What happens if you remove INC_APPEND_HISTORY as well (and
EXTENDED_HISTORY, too?)? It sounds like you might not want those set
explicitly.
From man zshoptions:
"""
SHARE_HISTORY <K>
This option both imports new commands from the history file, and also
causes your typed commands to be appended to the history file (the latter
is like specifying INC_APPEND_HISTORY). The history lines are also output
with timestamps ala EXTENDED_HISTORY (which makes it easier to find the
spot where we left off reading the file after it gets re-written).
"""
Best,
Ben
Messages sorted by:
Reverse Date,
Date,
Thread,
Author