Vscode terminal not loading .zshrc on startup! How can I fix this?

Viewed 1520

I have code package installed my on Pop!_OS 21.10, and recently after opening the integrated terminal, I noticed that it does not load my .zshrc.

Here are my settings:

 "terminal.integrated.defaultProfile.linux": "zsh",

Note: Everything works fine when I run source .zshrc after opening the integrated terminal, but it does not load the profile automatically. Anyone knows why?

2 Answers

I have already defined ZDOTDIR variable incorrectly pointing to .cache in my .zshrc, which made code to look over there for my config file.

The problem is solved now by defining ZDOTDIR as my $HOME directory.

Update:

-- $HOME is the default so I just deleted my definition.

The current version of VSCode may ignore your .zshrc in the following situation:

  • the option Terminal › Integrated › Shell Integration: Enabled (terminal.integrated.shellIntegration.enabled) is checked
  • the environment variable $ZDOTDIR is empty

Consider the comment and add the following line to your settings.json:

"terminal.integrated.profiles.osx": { "zsh": { "path": "/bin/zsh", "args": ["-l", "-i"] } }

(osx in the setting's name is for MacOS, linux is for Linux)

Related