vscode icon indicating copy to clipboard operation
vscode copied to clipboard

zsh history not working after update

Open pwegmueller opened this issue 2 years ago • 10 comments

Type: Bug

zsh history in terminal is not working anymore. MacOS - apple silicon chip

VS Code version: Code 1.74.0 (5235c6bb189b60b01b1f49062f4ffa42384f8c91, 2022-12-05T16:37:54.581Z) OS version: Darwin arm64 21.6.0 Modes: Sandboxed: No

pwegmueller avatar Dec 08 '22 05:12 pwegmueller

yes, this has impacted me this morning, for both stable build and insider build

I'm using M1 Apple Silicon

agentgill avatar Dec 08 '22 05:12 agentgill

I'm having the same problem.

macOS - Intel Core i7 VS Code version: Code 1.74.0 macOS version: 13.0.1 (22A400)

EricYangXD avatar Dec 08 '22 07:12 EricYangXD

echo $HISTFILE using a new profile directory without the default profile (current user).

jiangzm avatar Dec 08 '22 07:12 jiangzm

I can confirm the same problem with the zsh history

Version: 1.74.0
Commit: 5235c6bb189b60b01b1f49062f4ffa42384f8c91
Date: 2022-12-05T16:37:54.581Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin arm64 22.1.0
Sandboxed: No

Also, I can’t type Cyrillic letters anymore. This might be related:

https://user-images.githubusercontent.com/105274/206443255-d262d0d9-a57f-4566-a8b8-aa5174925fc6.mov

pepelsbey avatar Dec 08 '22 12:12 pepelsbey

Reinstalled 1.73, and now it works fine again

https://user-images.githubusercontent.com/105274/206444592-a971b564-6726-4592-96f5-1a70488a36fd.mov

https://code.visualstudio.com/updates/v1_73

pepelsbey avatar Dec 08 '22 12:12 pepelsbey

+1

illuspas avatar Dec 08 '22 13:12 illuspas

echo $HISTFILE
/var/folders/mw/96tsjxxxxxxxxxw0000gn/T/xxx-code-zsh/.zsh_history

Can confirm this bug on my M1 macOS Ventura

ProfFan avatar Dec 08 '22 14:12 ProfFan

Updated to 1.74 and vscode now uses it's own history file: $HISTFILE -> /var/folders/zc/3p6k6jwj3ql9_r6q_smnz53r0000gn/T/[username]-code-zsh/.zsh_history

instead of /Users/alexmirkin/.zsh_history

any way to change it?

Intel Mac

alexm-atbay avatar Dec 08 '22 14:12 alexm-atbay

A way to work around this for now is to set the HISTFILE in your .zshrc. For example:

HISTFILE=/Users/meganrogge/.zsh_history

meganrogge avatar Dec 08 '22 16:12 meganrogge

A way to work around this for now is to set the HISTFILE in your .zshrc. For example:

HISTFILE=/Users/meganrogge/.zsh_history

Or HISTFILE="$HOME/.zsh_history"

WhatsThatItsPat avatar Dec 08 '22 16:12 WhatsThatItsPat

Same issue here. I confirm setting HISTFILE variable directly in .zshrc does the trick (until this is fixed). However, If you have like me, an indirection to load vars from another file (ex: source $HOME/.zshrc.local), and you have your HISTFILE defined therein, it does not work. So, it must be defined directly in .zshrc.

ozeebee avatar Dec 09 '22 08:12 ozeebee

I was able to resolve this issue by disabling the setting: terminal.integrated.shellIntegration.enabled. For example,

Screen Shot 2022-12-09 at 2 06 35 PM

➜ printenv HISTFILE
/Users/conradwt/.zsh_history

Thus, one doesn't need to set the HISTFILE within $HOME/.zshrc file. Finally, a better fix for people may be to disable this setting, terminal.integrated.shellIntegration.enabled, by default.

conradwt avatar Dec 09 '22 22:12 conradwt

@conradwt that is not what I'd suggest as it will prevent you from using features. This will soon be fixed in our recovery release.

meganrogge avatar Dec 09 '22 22:12 meganrogge

@meganrogge Thanks for the feedback and I appreciate it.

conradwt avatar Dec 09 '22 22:12 conradwt

@meganrogge Thanks for the workaround. Works for me 👍

ahasna avatar Dec 10 '22 09:12 ahasna

@meganrogge thanks - did the trick for me as well.

pwegmueller avatar Dec 10 '22 22:12 pwegmueller

Y

I was able to resolve this issue by disabling the setting: terminal.integrated.shellIntegration.enabled. For example,

Screen Shot 2022-12-09 at 2 06 35 PM

➜ printenv HISTFILE
/Users/conradwt/.zsh_history

Thus, one doesn't need to set the HISTFILE within $HOME/.zshrc file. Finally, a better fix for people may be to disable this setting, terminal.integrated.shellIntegration.enabled, by default.

Thank for the trick, it's work again now

nth-zik avatar Dec 12 '22 02:12 nth-zik

Instead of disabling terminal.integrated.shellIntegration.enabled and lose features or modifying $HOME/.zshrc, we can add HISTFILE env var in vscode terminal settings as a temporary workaround.

image

"terminal.integrated.env.osx": {
    "HISTFILE": "$HOME/.zsh_history"
  }

vinothpandian avatar Dec 12 '22 16:12 vinothpandian

Same issue on intel mac book pro latest macos latest vs code

isAlmogK avatar Dec 12 '22 17:12 isAlmogK

@vinothpandian In general, I would prefer to set this setting within .zshrc because I prefer that VSCode inherits any and all shell or terminal-related settings from macOS.

conradwt avatar Dec 13 '22 00:12 conradwt

Fix ported to release branch already.

rebornix avatar Dec 13 '22 00:12 rebornix