* Thorsten Glaser <[email protected]> [2013-11-27 20:12]:
> Guido Berhoerster dixit:
> 
> >is there any way to keep history in sync between multiple running
> >shells
> 
> Enable persistent history (set $HISTFILE) in all of them, as
> prerequisite.
> 
> Then, to synchronise, simply press Enter.

Hmm, I've done a bit more testing, sometimes it works, sometimes
it does not, e.g. the following are two shells inside tmux, they
use the same $HISTFILE but one seems to have gone ahead of the
other and they do not get back in sync:

shell-1 23:59:15$ print shell-1 $HISTFILE
shell-1 /home/gber/.mksh_history
shell-1 00:00:24$
shell-1 00:00:27$ fc -l
2671    print shell-1 3
2672    print shell-1 4
2673    print shell-1 5
2674    print shell-1 6
2675    print shell-1 7
2676    print shell-1 8
2677    print shell-1 9
2678    print shell-1 10
2679    fc -l
2680    print shell-1 11
2681    print shell-1 12
2682    print shell-1 13
2683    print shell-1 14
2684    print shell-1 15
2685    fc -l
2686    print shell-1 $HISTFILE
shell-1 00:00:28$ print foo
foo

shell-2 23:59:58$
shell-2 00:01:54$
shell-2 00:04:17$ fc -l
2675    fc -l
2676    print shell-2 1
2677    print shell-2 2
2678    print shell-2 3
2679    print shell-2 4
2680    print shell-2 5
2681    print shell-2 6
2682    print shell-2 7
2683    print shell-2 8
2684    print shell-2 9
2685    print shell-2 10
2686    print shell-2 11
2687    print shell-2 12
2688    print shell-2 13
2689    print shell-2 14
2690    print shell-2 15
shell-2 00:04:19$
-- 
Guido Berhoerster

Reply via email to