Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$HISTFILE doesn't set .zhistory after upgrade to macOS Catalina #1744

Closed
entertvl opened this issue Oct 10, 2019 · 3 comments
Closed

$HISTFILE doesn't set .zhistory after upgrade to macOS Catalina #1744

entertvl opened this issue Oct 10, 2019 · 3 comments

Comments

@entertvl
Copy link

Description

At first it seemed that history-substring-search and autosuggestions were not work, but the value of $HISTFILE was not set .zhistory.

$ echo $HISTFILE
$ /Users/<user>/.zsh_history

I think this is because /etc/zshrc is loaded after upgrading macOS Catalina.
However, since this file cannot be edited by root, Can't be solved.

Expected behavior

Command history needs to be written to .zhistory.

Actual behavior

In addition to .zhistory, a .zsh_history file will be created.
The previous history will not be read.

Steps to Reproduce

Just upgrade macOS.

Versions

  • Prezto commit: 2873885
  • ZSH version: zsh 5.7.1 (x86_64-apple-darwin18.2.0)
  • OS information: macOS Catalina (10.15) Build: 19A583
@martinburger
Copy link

Commit 43214f1 introduced the allowance of a previously set HISTFILE value. As that variable is set in /etc/zshrc since Catalina, its value $HOME/.zsh_history takes precedence over the one used in .zprezto/modules/history/init.zsh since then.

As a workaround, add the following snippet to .zshrc just before Prezto is sourced:

#
# Workaround for: https://github.com/sorin-ionescu/prezto/issues/1744
#
export HISTFILE="${ZDOTDIR:-$HOME}/.zhistory" # The path to the history file.

Above snippet sets HISTFILE to $HOME/.zhistory which again is used in .zprezto/modules/history/init.zsh instead of the value previously set in /etc/zshrc.

@belak
Copy link
Collaborator

belak commented Oct 10, 2019

Interesting. I’m not sure if we want to override this or not since was a mechanism that let users override the setting if they wanted to.

@martinburger
Copy link

Interesting. I’m not sure if we want to override this or not since was a mechanism that let users override the setting if they wanted to.

I would prefer some setting in the history module that would allow me to configure whether any predefined value would take precedence or not. Like:

zstyle ':prezto:module:history:histfile:path' allowoverride 'yes'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants