Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Weird history behavior



On Jun 07 10:02PM, Bart Schaefer wrote:
On Tue, Jun 7, 2022 at 12:24 PM Adam Cooper <adam@xxxxxxxxxxxxxxxxx> wrote:

After installing xmonad on an Arch Linux system, my zsh history has begun to misbehave. HISTFILE is read from .zshenv after logging into the console, but once I start xmonad and a terminal, HISTFILE is empty.
[...]
Here is a link to my .zshenv: https://git.theadamcooper.com/adam/dotfiles/src/branch/master/arch/zsh/.zshenv

Well, there's this:
export ZDOTDIR="$XDG_CONFIG_HOME/zsh"

Once that's in the environment, $HOME/.zshenv isn't going to be read
any more, rather, the dot-files in $ZDOTDIR are going to be read
instead ... so you should look there.

My reading of the docs tells me that (in the absence of /etc/zsh/zshenv) ~/.zshenv is read first, and if ZDOTDIR is set there, the remaining configuration files will be read from ZDOTDIR. (Moving .zshenv into ZDOTDIR resulted in zsh displaying a menu with options for configuring zsh from the start.)

Evidence-wise, when I first log in to tty1, HISTFILE is set, as is HISTSIZE (conspicuously set to 9998), so I conclude .zshenv is being read. When I then run startx to enter xmonad, HISTFILE is unset, while HISTSIZE remains set. The only other configuration file, ZDOTDIR/.zshrc, is read correctly.




Messages sorted by: Reverse Date, Date, Thread, Author