mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-21 18:46:06 +02:00
The .zshrc the installer moves aside is where the user's SAVEHIST lives.
Once it is gone zsh falls back to a smaller value, lib/history.zsh
raises that to 10000, and the next clean shell exit rewrites $HISTFILE
with only the most recent 10000 entries. Anything older is gone, and
unlike the .zshrc, the history file was never backed up.
Copy the history alongside .zshrc.pre-oh-my-zsh at the moment the config
is replaced, and say so in the overwrite prompt. $HISTFILE is a zsh
variable the installer cannot read, so cover both locations it is
commonly given: macOS /etc/zshrc sets ${ZDOTDIR:-$HOME}/.zsh_history,
and lib/history.zsh falls back to $HOME/.zsh_history.
This does not stop the trim itself, which is governed by SAVEHIST; it
makes the lost history recoverable.
Closes #10908
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>