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
zsh HISTFILE, HISTSIZE not set? #177
Comments
Thanks for reporting the issue. I confirm that The reason is that I'll create PR in oh-my-zsh to add condition similar to |
Seems like this issue was already brought up in |
HISTSIZE has to be set before sourcing oh-my-zsh since otherwise it will be overridden. Fixes nix-community#177.
Thanks for the speedy response, Nikita. I'm a little confused though, since I do not use |
No, with Do you have So it seems that it works for me with oh-my-zsh disabled because I only have The proposed patch should fix your case too, but I see that we should do the same for |
HISTSIZE and HISTFILE have to be set in ~/.zshrc and before sourcing oh-my-zsh since otherwise it will be overridden. Fixes nix-community#177.
Thank you for the explanation and the fast fix. |
HISTSIZE and HISTFILE should be set in ~/.zshrc and before sourcing oh-my-zsh since otherwise it will be overridden. Fixes nix-community#177.
Much like Nix's tmux defaults, the Home Manager's defaults for zsh have a lot of configurations set by default: cat ~/.zshrc typeset -U path cdpath fpath manpath for profile in ${(z)NIX_PROFILES}; do fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) done HELPDIR="/nix/store/xkr4dr8zhi1r1k4x0w17hhprj62cjxw2-zsh-5.9/share/zsh/$ZSH_VERSION/help" # Oh-My-Zsh/Prezto calls compinit during initialization, # calling it twice causes slight start up slowdown # as all $fpath entries will be traversed again. autoload -U compinit && compinit # History options should be set in .zshrc and after oh-my-zsh sourcing. # See nix-community/home-manager#177. HISTSIZE="10000" SAVEHIST="10000" HISTFILE="$HOME/.zsh_history" mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE unsetopt HIST_EXPIRE_DUPS_FIRST setopt SHARE_HISTORY unsetopt EXTENDED_HISTORY # Aliases # Named Directory Hashes I'm not too familiar with how Nix works, but I'd assume that the first part is there to make sure Nix can properly function. Then, the compinit line can be disabled by switching off `enableCompletion`: programs.zsh = { enable = true; enableCompletion = false; }; Aside from that, there doesn't seem to be a way to turn the hisotry settings off outside of overwriting their values.
Much like Nix's tmux defaults, the Home Manager's defaults for zsh have a lot of configurations set by default: cat ~/.zshrc typeset -U path cdpath fpath manpath for profile in ${(z)NIX_PROFILES}; do fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) done HELPDIR="/nix/store/xkr4dr8zhi1r1k4x0w17hhprj62cjxw2-zsh-5.9/share/zsh/$ZSH_VERSION/help" # Oh-My-Zsh/Prezto calls compinit during initialization, # calling it twice causes slight start up slowdown # as all $fpath entries will be traversed again. autoload -U compinit && compinit # History options should be set in .zshrc and after oh-my-zsh sourcing. # See nix-community/home-manager#177. HISTSIZE="10000" SAVEHIST="10000" HISTFILE="$HOME/.zsh_history" mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE unsetopt HIST_EXPIRE_DUPS_FIRST setopt SHARE_HISTORY unsetopt EXTENDED_HISTORY # Aliases # Named Directory Hashes I'm not too familiar with how Nix works, but I'd assume that the first part is there to make sure Nix can properly function. Then, the compinit line can be disabled by switching off `enableCompletion`: programs.zsh = { enable = true; enableCompletion = false; }; Aside from that, there doesn't seem to be a way to turn the hisotry settings off outside of overwriting their values.
Much like Nix's tmux defaults, the Home Manager's defaults for zsh have a lot of configurations set by default: cat ~/.zshrc typeset -U path cdpath fpath manpath for profile in ${(z)NIX_PROFILES}; do fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) done HELPDIR="/nix/store/xkr4dr8zhi1r1k4x0w17hhprj62cjxw2-zsh-5.9/share/zsh/$ZSH_VERSION/help" # Oh-My-Zsh/Prezto calls compinit during initialization, # calling it twice causes slight start up slowdown # as all $fpath entries will be traversed again. autoload -U compinit && compinit # History options should be set in .zshrc and after oh-my-zsh sourcing. # See nix-community/home-manager#177. HISTSIZE="10000" SAVEHIST="10000" HISTFILE="$HOME/.zsh_history" mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE unsetopt HIST_EXPIRE_DUPS_FIRST setopt SHARE_HISTORY unsetopt EXTENDED_HISTORY # Aliases # Named Directory Hashes I'm not too familiar with how Nix works, but I'd assume that the first part is there to make sure Nix can properly function. Then, the compinit line can be disabled by switching off `enableCompletion`: programs.zsh = { enable = true; enableCompletion = false; }; Aside from that, there doesn't seem to be a way to turn the hisotry settings off outside of overwriting their values.
Much like Nix's tmux defaults, the Home Manager's defaults for zsh have a lot of configurations set by default: cat ~/.zshrc typeset -U path cdpath fpath manpath for profile in ${(z)NIX_PROFILES}; do fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) done HELPDIR="/nix/store/xkr4dr8zhi1r1k4x0w17hhprj62cjxw2-zsh-5.9/share/zsh/$ZSH_VERSION/help" # Oh-My-Zsh/Prezto calls compinit during initialization, # calling it twice causes slight start up slowdown # as all $fpath entries will be traversed again. autoload -U compinit && compinit # History options should be set in .zshrc and after oh-my-zsh sourcing. # See nix-community/home-manager#177. HISTSIZE="10000" SAVEHIST="10000" HISTFILE="$HOME/.zsh_history" mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE unsetopt HIST_EXPIRE_DUPS_FIRST setopt SHARE_HISTORY unsetopt EXTENDED_HISTORY # Aliases # Named Directory Hashes I'm not too familiar with how Nix works, but I'd assume that the first part is there to make sure Nix can properly function. Then, the compinit line can be disabled by switching off `enableCompletion`: programs.zsh = { enable = true; enableCompletion = false; }; Aside from that, there doesn't seem to be a way to turn the hisotry settings off outside of overwriting their values.
Much like Nix's tmux defaults, the Home Manager's defaults for zsh have a lot of configurations set by default: cat ~/.zshrc typeset -U path cdpath fpath manpath for profile in ${(z)NIX_PROFILES}; do fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) done HELPDIR="/nix/store/xkr4dr8zhi1r1k4x0w17hhprj62cjxw2-zsh-5.9/share/zsh/$ZSH_VERSION/help" # Oh-My-Zsh/Prezto calls compinit during initialization, # calling it twice causes slight start up slowdown # as all $fpath entries will be traversed again. autoload -U compinit && compinit # History options should be set in .zshrc and after oh-my-zsh sourcing. # See nix-community/home-manager#177. HISTSIZE="10000" SAVEHIST="10000" HISTFILE="$HOME/.zsh_history" mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE unsetopt HIST_EXPIRE_DUPS_FIRST setopt SHARE_HISTORY unsetopt EXTENDED_HISTORY # Aliases # Named Directory Hashes I'm not too familiar with how Nix works, but I'd assume that the first part is there to make sure Nix can properly function. Then, the compinit line can be disabled by switching off `enableCompletion`: programs.zsh = { enable = true; enableCompletion = false; }; Aside from that, there doesn't seem to be a way to turn the hisotry settings off outside of overwriting their values.
Much like Nix's tmux defaults, the Home Manager's defaults for zsh have a lot of configurations set by default: cat ~/.zshrc typeset -U path cdpath fpath manpath for profile in ${(z)NIX_PROFILES}; do fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) done HELPDIR="/nix/store/xkr4dr8zhi1r1k4x0w17hhprj62cjxw2-zsh-5.9/share/zsh/$ZSH_VERSION/help" # Oh-My-Zsh/Prezto calls compinit during initialization, # calling it twice causes slight start up slowdown # as all $fpath entries will be traversed again. autoload -U compinit && compinit # History options should be set in .zshrc and after oh-my-zsh sourcing. # See nix-community/home-manager#177. HISTSIZE="10000" SAVEHIST="10000" HISTFILE="$HOME/.zsh_history" mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE unsetopt HIST_EXPIRE_DUPS_FIRST setopt SHARE_HISTORY unsetopt EXTENDED_HISTORY # Aliases # Named Directory Hashes I'm not too familiar with how Nix works, but I'd assume that the first part is there to make sure Nix can properly function. Then, the compinit line can be disabled by switching off `enableCompletion`: programs.zsh = { enable = true; enableCompletion = false; }; Aside from that, there doesn't seem to be a way to turn the hisotry settings off outside of overwriting their values.
Much like Nix's tmux defaults, the Home Manager's defaults for zsh have a lot of configurations set by default: cat ~/.zshrc typeset -U path cdpath fpath manpath for profile in ${(z)NIX_PROFILES}; do fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) done HELPDIR="/nix/store/xkr4dr8zhi1r1k4x0w17hhprj62cjxw2-zsh-5.9/share/zsh/$ZSH_VERSION/help" # Oh-My-Zsh/Prezto calls compinit during initialization, # calling it twice causes slight start up slowdown # as all $fpath entries will be traversed again. autoload -U compinit && compinit # History options should be set in .zshrc and after oh-my-zsh sourcing. # See nix-community/home-manager#177. HISTSIZE="10000" SAVEHIST="10000" HISTFILE="$HOME/.zsh_history" mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE unsetopt HIST_EXPIRE_DUPS_FIRST setopt SHARE_HISTORY unsetopt EXTENDED_HISTORY # Aliases # Named Directory Hashes I'm not too familiar with how Nix works, but I'd assume that the first part is there to make sure Nix can properly function. Then, the compinit line can be disabled by switching off `enableCompletion`: programs.zsh = { enable = true; enableCompletion = false; }; Aside from that, there doesn't seem to be a way to turn the hisotry settings off outside of overwriting their values.
Much like Nix's tmux defaults, the Home Manager's defaults for zsh have a lot of configurations set by default: cat ~/.zshrc typeset -U path cdpath fpath manpath for profile in ${(z)NIX_PROFILES}; do fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) done HELPDIR="/nix/store/xkr4dr8zhi1r1k4x0w17hhprj62cjxw2-zsh-5.9/share/zsh/$ZSH_VERSION/help" # Oh-My-Zsh/Prezto calls compinit during initialization, # calling it twice causes slight start up slowdown # as all $fpath entries will be traversed again. autoload -U compinit && compinit # History options should be set in .zshrc and after oh-my-zsh sourcing. # See nix-community/home-manager#177. HISTSIZE="10000" SAVEHIST="10000" HISTFILE="$HOME/.zsh_history" mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE unsetopt HIST_EXPIRE_DUPS_FIRST setopt SHARE_HISTORY unsetopt EXTENDED_HISTORY # Aliases # Named Directory Hashes I'm not too familiar with how Nix works, but I'd assume that the first part is there to make sure Nix can properly function. Then, the compinit line can be disabled by switching off `enableCompletion`: programs.zsh = { enable = true; enableCompletion = false; }; Aside from that, there doesn't seem to be a way to turn the hisotry settings off outside of overwriting their values.
Much like Nix's tmux defaults, the Home Manager's defaults for zsh have a lot of configurations set by default: cat ~/.zshrc typeset -U path cdpath fpath manpath for profile in ${(z)NIX_PROFILES}; do fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) done HELPDIR="/nix/store/xkr4dr8zhi1r1k4x0w17hhprj62cjxw2-zsh-5.9/share/zsh/$ZSH_VERSION/help" # Oh-My-Zsh/Prezto calls compinit during initialization, # calling it twice causes slight start up slowdown # as all $fpath entries will be traversed again. autoload -U compinit && compinit # History options should be set in .zshrc and after oh-my-zsh sourcing. # See nix-community/home-manager#177. HISTSIZE="10000" SAVEHIST="10000" HISTFILE="$HOME/.zsh_history" mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE unsetopt HIST_EXPIRE_DUPS_FIRST setopt SHARE_HISTORY unsetopt EXTENDED_HISTORY # Aliases # Named Directory Hashes I'm not too familiar with how Nix works, but I'd assume that the first part is there to make sure Nix can properly function. Then, the compinit line can be disabled by switching off `enableCompletion`: programs.zsh = { enable = true; enableCompletion = false; }; Aside from that, there doesn't seem to be a way to turn the hisotry settings off outside of overwriting their values.
Much like Nix's tmux defaults, the Home Manager's defaults for zsh have a lot of configurations set by default: cat ~/.zshrc typeset -U path cdpath fpath manpath for profile in ${(z)NIX_PROFILES}; do fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) done HELPDIR="/nix/store/xkr4dr8zhi1r1k4x0w17hhprj62cjxw2-zsh-5.9/share/zsh/$ZSH_VERSION/help" # Oh-My-Zsh/Prezto calls compinit during initialization, # calling it twice causes slight start up slowdown # as all $fpath entries will be traversed again. autoload -U compinit && compinit # History options should be set in .zshrc and after oh-my-zsh sourcing. # See nix-community/home-manager#177. HISTSIZE="10000" SAVEHIST="10000" HISTFILE="$HOME/.zsh_history" mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE unsetopt HIST_EXPIRE_DUPS_FIRST setopt SHARE_HISTORY unsetopt EXTENDED_HISTORY # Aliases # Named Directory Hashes I'm not too familiar with how Nix works, but I'd assume that the first part is there to make sure Nix can properly function. Then, the compinit line can be disabled by switching off `enableCompletion`: programs.zsh = { enable = true; enableCompletion = false; }; Aside from that, there doesn't seem to be a way to turn the hisotry settings off outside of overwriting their values.
Much like Nix's tmux defaults, the Home Manager's defaults for zsh have a lot of configurations set by default: cat ~/.zshrc typeset -U path cdpath fpath manpath for profile in ${(z)NIX_PROFILES}; do fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions) done HELPDIR="/nix/store/xkr4dr8zhi1r1k4x0w17hhprj62cjxw2-zsh-5.9/share/zsh/$ZSH_VERSION/help" # Oh-My-Zsh/Prezto calls compinit during initialization, # calling it twice causes slight start up slowdown # as all $fpath entries will be traversed again. autoload -U compinit && compinit # History options should be set in .zshrc and after oh-my-zsh sourcing. # See nix-community/home-manager#177. HISTSIZE="10000" SAVEHIST="10000" HISTFILE="$HOME/.zsh_history" mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE unsetopt HIST_EXPIRE_DUPS_FIRST setopt SHARE_HISTORY unsetopt EXTENDED_HISTORY # Aliases # Named Directory Hashes I'm not too familiar with how Nix works, but I'd assume that the first part is there to make sure Nix can properly function. Then, the compinit line can be disabled by switching off `enableCompletion`: programs.zsh = { enable = true; enableCompletion = false; }; Aside from that, there doesn't seem to be a way to turn the hisotry settings off outside of overwriting their values.
I don't know if this is an issue with home-manager or something bigger than that, but I'm not able to set my
HISTSIZE
by doingor
since it's overwritten by
/etc/zshrc
.The post that prompted it on reddit: https://www.reddit.com/r/NixOS/comments/7pt34f/how_to_stop_etczshrc_from_overwriting_histfile/
The text was updated successfully, but these errors were encountered: