Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Histfile in integrated terminal not the same as normal terminal

I just lost my terminal history in VS Code. I noticed it when trying to do a reverse search in the Integrated Terminal (CTRL+R).

To debug, I ran this command:

echo $HISTFILE

This gives me:

/var/folders/ky/ltbvkg9s1239m5c9bccj5xtc0000gn/T/johndoe-code-zsh/.zsh_history

I would expect the normal path of my ZSH history is shown instead, like I get in iTerm2 when running the same command.

/Users/johndoe/.zsh_history

enter image description here

like image 460
studio-pj Avatar asked Dec 04 '25 16:12

studio-pj


1 Answers

I believe this is a bug with VSCode's ZSH shell integration, that has already been resolved on the Insiders version.

Here is the offending line (note the HISTFILE without $):

Code diff

I've seen it merged into the release/1.74 branch so hopefully, a v1.74.1 is not too far away. In the meanwhile, you can switch to Insiders (side-by-side installation) or turn off shell integration as suggested in the other answer.

like image 97
sohrab Avatar answered Dec 07 '25 03:12

sohrab



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!