Prezto: HISTFILE defaults to .zhistory rather than .zsh_history

Created on 4 Dec 2019  ·  9Comments  ·  Source: sorin-ionescu/prezto

Description


When migrating from oh-my-zsh I lost my history and didn't initially understand why.

oh-my-zsh uses .zsh_history for history, see lib/history.zsh

Expected behavior

By default, without configuration, I should be able to continue using my existing history file .zsh_history.

Actual behavior

The prezto history modules defaults HISTFILE to .zhistory

Steps to Reproduce

Versions

  • Prezto commit: 2d6205e71404704eecc4f402e5b09d7cbd19bab7
  • ZSH version: zsh 5.7.1 (x86_64-apple-darwin18.2.0)
  • OS information: macOS 10.14.6

Most helpful comment

Thanks for the feedback! Unfortunately, I don't think we will end up doing this... it doesn't make sense to support an alternative default location for the HISTFILE because we're two different frameworks. If you want to use a different HISTFILE, you can set that variable manually. We honor that variable when it is manually set.

I'd also rather optimize for usage rather than setup... and I don't want to introduce either a dynamic HISTFILE variable that changes depending on which files exist... or change the default to something other than what our users have had for many years.

All 9 comments

Thanks for the feedback! Unfortunately, I don't think we will end up doing this... it doesn't make sense to support an alternative default location for the HISTFILE because we're two different frameworks. If you want to use a different HISTFILE, you can set that variable manually. We honor that variable when it is manually set.

I'd also rather optimize for usage rather than setup... and I don't want to introduce either a dynamic HISTFILE variable that changes depending on which files exist... or change the default to something other than what our users have had for many years.

Maybe a note in modules/history/README.md would help avoid surprises?

That seems reasonable. Might even be good to have a “migrating from OMZ doc”.

Added some basic documentation to modules/history/README.md. Thanks for the suggestion!

Thanks @belak !

FYI: ${ZDOTDIR:-$HOME}/.zsh_history is also the default set on macOS in /etc/zshrc

Ah, interesting, it might be worth changing then. Thanks for following up!

👍

I did a little more research and took a look at ubuntu. History saving isn't configured out of the box, but the recommendation is ~/.zsh_history too, see /etc/zsh/newuser.zshrc.recommended

Now that I recall, this did trip me when I first installed prezto. Probably, because I was migrating from OMZ.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EllieRagone picture EllieRagone  ·  4Comments

ww7 picture ww7  ·  4Comments

michaelaye picture michaelaye  ·  4Comments

wiesson picture wiesson  ·  5Comments

gdetrez picture gdetrez  ·  5Comments