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

Re: Shell history, the same in each session

On 1/17/21 3:36 PM, Eric Cook wrote:
On 1/16/21 4:25 PM, Forrest Aldrich wrote:
I'm somewhat new to ZSH; however, I'm using the DEV version on MacOS Big Sur and I do keep it up to date.

One issue I'm having is that my ZSH shell history seems to be unified -- that is, in different terminal windows I get shell history from separate sessions, which is not what I would expect (or desire).  It makes finding recent commands a pain -- and I
wonder if there is a setting I've overlooked that will keep shell history in the current window isolated to that terminal session (until I exit, etc).


Something is enabling the share_history option, by default it is off.
you could ''unsetopt share_history'' to disable it or find where it is being set and remove it.

Thank you!

I am using Oh-My-Zsh and I found this, in ./lib/history.zsh:

## History command configuration
setopt extended_history       # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups       # ignore duplicated commands history list
setopt hist_ignore_space      # ignore commands that start with space
setopt hist_verify            # show command with history expansion to user before running it
setopt share_history          # share command history data

Seems like an odd default assumption to have.


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