I recently updated my VSCode to the latest version and found that the zsh history is not working anymore. That’s how it looks when running the
history command with only a few commands showing up.
echo $HISTFILE, it shows some random path that I don’t recognize. It should be
Others have reported the same issue on the VSCode GitHub repo for VS Code 1.74.0.
The solution is to add the following line to your
~/.zshrc file to set the
HISTFILE variable explicitly.
After that, run
source ~/.zshrc to reload the configuration file. Now the
HISTFILE variable should be set correctly thus the zsh history is working again.