Open devmattrick opened 1 year ago
Tried the extension for the first time last night and found it very strange that the terminal wasn't affected by the nix environment. Glad to see this might be unintentional.
I have found a temporary workaround for those who are using launch.json.
Perhaps it is possible to find a similar solution for a global case, but for me, launch.json fix is enough.
Basically, all you need to do is manually pass the $PATH
environment:
{
"version": "0.2.0",
"configurations": [
{
"name": "My Project",
// ...
"env": {
"PATH": "${env:PATH}",
},
// ...
}
]
}
Edit: This worked with Python module launch but not with Python file launch. This may not work in all scenarios.
For a global solution you could automatically enter nix-shell if present in the current directory.
An example using .zshrc
:
if [ -f ./shell.nix ]; then
if [ -z "$IN_NIX_SHELL" ]; then
nix-shell
fi
fi
Describe the bug I'm not sure if this is caused by the VSCode update that came out recently, but I noticed that the shell.nix file no longer seems to be being applied to the integrated terminal. I noticed it after updating to the most recent version but it could also be unrelated to that.
To Reproduce Steps to reproduce the behavior:
nix-shell ./shell.nix
Expected behavior The integrated terminal should load with the executables (and libraries) provided in shell.nix.
Screenshots N/A
Environment:
Additional context N/A