When reopening my workspace in a devcontainer, these environment variables fail to be interpolated and cause the devcontainer to fail to open. This is not an issue that I encounter when using vscode.
Steps to Reproduce
See above.
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
It looks like this is a limitation of the Anysphere devcontainer extension. localEnv interpolation was added for remoteUser and remoteEnv, but it’s not fully implemented for mounts yet.
A couple of quick questions:
What’s the exact error message you get when opening the container?
Are the variables defined directly in ~/.bashrc, or is it a symlink to another file?
As a temporary workaround, try hardcoding the path directly instead of ${localEnv:MOUNT_SOURCE}:
Or export the variables in ~/.zshenv or /etc/environment. Those files are read for non-interactive shells.
This is a known limitation of the Anysphere devcontainer extension compared to VS Code. I’ve shared it with the team, they’re actively working on feature parity.
I’ve passed the info to the team. Let me know if the workaround doesn’t help.