I have a task in vscode to automatically call nix-shell in the integrated terminal when a folder is opened to set up the environment, it seems to work but the only problem is that the task keeps running forever as long as the terminal is in nix-shell, it terminates when I call to exit the nix-shell. Is there a way set this task to terminate when the terminal enters in nix-shell? It seems something that should be simple but I couldn’t find a solution.
PS: I am aware of direnv e the extension nix-env-selector but what I want is something simple and I would like to know if it is possible to do this only using tasks in vscode.
Thanks.
This is the contents of the tasks.json file, the file ambientenix.sh just call “nix-shell”:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Ambiente Nix",
"type": "shell",
"command": "./scripts/ambientenix.sh",
"group": "none",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"runOptions": {
"runOn": "folderOpen",
"instanceLimit": 1
}
}
]
}