Wanna see something cool? Check out Angular Spotify 🎧

zsh history not working after VSCode upgrade

Problem

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.

When running echo $HISTFILE, it shows some random path that I don’t recognize. It should be ~/.zsh_history instead.

zsh history not working

Others have reported the same issue on the VSCode GitHub repo for VS Code 1.74.0.

https://github.com/microsoft/vscode/issues/168396

zsh history not working

Solution

The solution is to add the following line to your ~/.zshrc file to set the HISTFILE variable explicitly.

HISTFILE="$HOME/.zsh_history"

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.

zsh history working

Published 12 Dec 2022

    Read more

     — The different between :focus and :focus-visible
     — Angular 13 upgrade - Error: Unknown keyword formatMinimum
     — ngIf - Store the conditional result in a variable
     — Common use cases and solutions for accessibility in Angular
     — Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)

    Follow @trungvose on Twitter for more!