Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: How to save history between session



On Wed, 13 Apr 2011 17:58:38 +0800
first name <33facebook@xxxxxxxxx> wrote:
> the shell doesn't remember history between different terminals..not to
> mention after a logout and login.
> how to fix it?
> thanks

To fix the second problem, in ~/.zshsrc set HISTFILE to a file where you
want to save the history and SAVEHIST to the number of lines to save.
If you make this large, set HISTSIZE to the same value (not needed but
usually the right thing to do).  In my ~/.zshsrc I have

HISTSIZE=1000
if (( ! EUID )); then
  HISTFILE=~/.history_root
else
  HISTFILE=~/.history
fi
SAVEHIST=1000

To fix the first problem, it sounds like you probably want to add
"setopt SHARE_HISTORY" to your ~/.zshrc but there are other
possibilities described in the "History" section of the zshoptions
manual page.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



Messages sorted by: Reverse Date, Date, Thread, Author