Sample Header Ad - 728x90

macOS .zsh_sessions, .zsh_history, and `setopt APPEND_HISTORY`

8 votes
1 answer
18611 views
On macOS, there is a sessions directory that combines commands from multiple zsh sessions into a single history file. Is it necessary to use [tag:zsh] *shell options* in the .zshrc file, to manipulate how zsh handles history, so that commands are appended to .zsh_history, or are these options redundant and ignored? I see many people recommend, when transitioning from bash to zsh, to add the following options to make history include commands from other sessions and add other functionality (that appears to be built in):
APPEND_HISTORY
HISTFILE=~/.zsh_history
HISTSIZE=100000000
SAVEHIST=100000000
setopt INC_APPEND_HISTORY
[...]
However, it seems those are built in and needn't be specified. Bonus question: Can one list multiple shell options after a single setopt, instead of having each option in a separate setopt statement?
Asked by John (1248 rep)
Sep 19, 2021, 02:22 AM
Last activity: May 6, 2025, 07:32 AM