New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shell doesn't inherit env variables in vscode 1.64.0 #833
Comments
hi @Choooks22 a few questions:
|
it's set in
"terminal.integrated.inheritEnv": true |
@Choooks22 please see this comment for a detailed explanation of how jest is executed in the shell env. Essentially we use a non-login/non-interactive shell, so it inherits vscode process env and does not automatically source This is different from vscode terminal, which creates a login shell, so it always sources the setup files (rc, profile etc). The terminal setting I am not sure what vscode 1.64.0 has changed to impact this behavior, maybe it failed to fully initialize the process env during the start-up? Perhaps try to launch vscode from a Linux terminal (which should have the env initialized) to see if it works, or explicitly set the path with |
@connectdotz thanks for your time, launching vscode from a terminal indeed does inherit the envs, so somehow upgrading vscode changed something(?) sadly, I couldn't just hardcode I'll be closing this for now since it doesn't seem to be the extension's issue, thanks again for the help 👍 |
Environment
vscode-jest version
:4.2.1
node -v
:16.13.2
npm -v
oryarn --version
:8.1.2
npm ls jest
ornpm ls react-scripts
(if you haven’t ejected):27.4.7
"jest.shell": "zsh"
pnpm 6.29.1
"jest.jestCommandLine": "pnpm t --"
Prerequisite
npm run test
ornode_modules/.bin/jest
)pnpm t
Steps to Reproduce
Upgrade to vscode
1.64.0
, making sure that the path to your package manager is set by a profile like.zshrc
Relevant Debug Info
Replace
jestCommandLine
withecho $PATH &&
.It should print out the system default
PATH
variable, without inheriting from the values set by the profile files.Running
echo $PATH
in the integrated terminal works fine.Running vscode
1.63.2
works fine.Related vscode config:
terminal.integrated.inheritEnv
Expected Behavior
Runs as normal.
Actual Behavior
The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR...
The text was updated successfully, but these errors were encountered: