Dev Container Mounts can not use local variables

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I have mounts listed in my devcontainer.json. Some of these mounts interpolate environment variables that I have defined in my ~/.bashrc, e.g.

    "source=${localEnv:MOUNT_SOURCE},target=/mount/dest,type=bind"

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)

Version: 2.3.35 (Universal)
VSCode Version: 1.105.1
Commit: cf8353edc265f5e46b798bfb276861d0bf3bf120
Date: 2026-01-13T07:39:18.564Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.2.0

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey, thanks for the report.

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:

  1. What’s the exact error message you get when opening the container?
  2. 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}:

"source=/absolute/path/to/mount,target=/mount/dest,type=bind"

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.