Open
Description
As soon as I add the following snippet to my user settings.json
, this direnv extension stops to properly expose environments to tasks of type shell
as it previously did:
{
// ..
"terminal.integrated.env.linux": {
"PATH": "/run/current-system/sw/bin",
},
// ..
}
As soon as I comment out this setting, it starts to work again.
Here's a tasks.json
file to reproduce:
{
"version": "2.0.0",
"tasks": [
{
"label": "My task description",
"type": "shell",
"command": "my-direnv-provided-exe",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Here's the error I get:
* Executing task: my-direnv-provided-exe
/run/current-system/sw/bin/bash: line 1: my-direnv-provided-exe: command not found
* The terminal process "/run/current-system/sw/bin/bash '-c', 'my-direnv-provided-exe'" failed to launch (exit code: 127).
* Terminal will be reused by tasks, press any key to close it.
Here's the expected behavior:
* Executing task: my-direnv-provided-exe
Hello from 'my-direnv-provided-exe'!
* Terminal will be reused by tasks, press any key to close it.
You can use an .envrc
such as:
PATH="$PATH:$PWD/bin"
And a my-direnv-provided-exe
script under a bin
directory in your workspace:
#!/bin/sh
echo "Hello from 'my-direnv-provided-exe'!"
Don't forget to chmod a+x ./bin/my-direnv-provided-exe
.
Note that in order to reproduce you might have to remove ~/.config/Code
is order to reproduce as vscode seems to be persisting some cache of a task's environment. Don't forget to add the settings.json
snippet again after removal.
Metadata
Metadata
Assignees
Labels
No labels