vscode-remote-release
vscode-remote-release copied to clipboard
devcontainer.json: add support for multi-platform "localEnv" in "mounts"
First and foremost: thank you guys for your amazing work with VSCode!
Use Case
I have a devcontainer.json that on Windows mounts "/home/nwtimetracking/" to "C:\Users\Desktop<my_username>\nwtimetracking".
The problem arises when I load the project on Linux, where I do get a "A mount config is invalid" error message and I can't proceed until I manually switch USERPROFILE with HOME.
devcontainer.json https://github.com/numbworks/nwtimetracking/blob/master/.devcontainer/devcontainer.json
{
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-toolsai.datawrangler",
"shd101wyy.markdown-preview-enhanced"
]
}
},
"mounts": [
"source=${localEnv:USERPROFILE}/Desktop/nwtimetracking/,target=/home/nwtimetracking/,type=bind,consistency=cached"
]
}
As far as I know and at the moment of writing:
{localEnv:USERPROFILE}works only for Windows{localEnv:HOME}works only for Linux/MacOS
Feature Request
If would be nice to have some kind of conditional logic that allows the use of both dynamically, according to the OS on which VSCode is running at the moment. Or a combo label that identifies the DESKTOP on all the supported OSes. Or similar solution.
Or if you are aware of a workaround for this issue, I would be glad to know!
Thank you!
We have sometimes used {localEnv:USERPROFILE}{localEnv:HOME} as a workaround (assuming one is always empty and the other one set).
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 10 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
@chrmarti Thank you for your kind and quick reply!
I'll give it a try! If it works, it's good enough on my perspective!
this could be useful!
Upvote
I also need this
upvote!
Upvote
Upvote
Upvote
Upvote
Upvote!
Upvote!
:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
@chrmarti Any idea when the team will start working on this fix?
I tried your workaround on two different Linux machines and three different versions of VSCode, but it doesn't work at all.
We have sometimes used {localEnv:USERPROFILE}{localEnv:HOME} as a workaround (assuming one is always empty and the other one set).