* sync history between sessions without entering 'history' command
@ 2009-03-09 13:22 Ye, Jianye
2009-03-09 13:33 ` Angel Olivera
0 siblings, 1 reply; 4+ messages in thread
From: Ye, Jianye @ 2009-03-09 13:22 UTC (permalink / raw)
To: zsh-users
[-- Attachment #1: Type: text/plain, Size: 570 bytes --]
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 ?
[-- Attachment #2: Type: text/html, Size: 638 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sync history between sessions without entering 'history' command
2009-03-09 13:22 sync history between sessions without entering 'history' command Ye, Jianye
@ 2009-03-09 13:33 ` Angel Olivera
2009-03-09 14:21 ` Ye, Jianye
0 siblings, 1 reply; 4+ messages in thread
From: Angel Olivera @ 2009-03-09 13:33 UTC (permalink / raw)
To: zsh-users
[-- Attachment #1: Type: text/plain, Size: 782 bytes --]
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.
--
redondos
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 489 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sync history between sessions without entering 'history' command
2009-03-09 13:33 ` Angel Olivera
@ 2009-03-09 14:21 ` Ye, Jianye
2009-03-09 15:16 ` Benjamin R. Haskell
0 siblings, 1 reply; 4+ messages in thread
From: Ye, Jianye @ 2009-03-09 14:21 UTC (permalink / raw)
To: zsh-users
[-- Attachment #1: Type: text/plain, Size: 861 bytes --]
2009/3/9 Angel Olivera <redondos@twat.com.ar>
> 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.
[-- Attachment #2: Type: text/html, Size: 1354 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sync history between sessions without entering 'history' command
2009-03-09 14:21 ` Ye, Jianye
@ 2009-03-09 15:16 ` Benjamin R. Haskell
0 siblings, 0 replies; 4+ messages in thread
From: Benjamin R. Haskell @ 2009-03-09 15:16 UTC (permalink / raw)
To: Zsh Users
On Mon, 9 Mar 2009, Ye, Jianye wrote:
> 2009/3/9 Angel Olivera <redondos@twat.com.ar>
>
> > 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-03-09 15:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-09 13:22 sync history between sessions without entering 'history' command Ye, Jianye
2009-03-09 13:33 ` Angel Olivera
2009-03-09 14:21 ` Ye, Jianye
2009-03-09 15:16 ` Benjamin R. Haskell
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).