Cursor's Dev Container env resolution truncates variable values at = (works correctly in VS Code)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Hi Cursor team,

I’ve hit a reproducible bug in how Cursor resolves and injects environment variables into Dev Containers. A variable whose value contains an = character gets truncated at the first = when Cursor builds/opens the Dev Container. VS Code (Dev Containers extension) handles the same setup correctly, so this is specific to Cursor’s remote/dev-container server.

Steps to Reproduce

Setup

  • Host (WSL) ~/.bashrc: export BITBUCKET_TOKEN="ATATT...=XXXXXXXX" (full value, 192 chars; unchanged for weeks).
  • devcontainer.json:
    "containerEnv": {
      "BITBUCKET_TOKEN": "${localEnv:BITBUCKET_TOKEN}",
      "BITBUCKET_USERNAME": "${localEnv:BITBUCKET_USERNAME}"
    }
    

Expected Behavior

The container receives the full 192-char value, including everything after the = (as VS Code does).

Actual behavior (Cursor)
The container receives only the 183 characters before the = — the = and the trailing checksum are dropped. This produces an invalid token (downstream Bitbucket API calls fail with HTTP 401).

Evidence / root cause
On the same machine there are two servers running side by side:

  • VS Code server (~/.vscode-server/...) and all host processes: BITBUCKET_TOKEN length = 192 (correct, ends ...=XXXXXXXX).
  • Cursor server (~/.cursor-server/.../node) and everything it spawns inside the Dev Container: BITBUCKET_TOKEN length = 183 (truncated, ends ...kCKO4w_c, =-tail missing).

I confirmed the truncation happens before the value reaches the container config — the Dev Container’s Config.Env was already 183 at creation, and the raw env line contains only the single KEY=VALUE separator (the value’s internal = is gone). No file or Windows environment variable on the machine contains the truncated value, so it is produced algorithmically during Cursor’s shell-environment resolution / ${localEnv} substitution — it appears to split KEY=VALUE on all = and keep only the field before the value’s embedded =.

Reproduction (minimal)

  1. On the host, export a variable whose value contains =, e.g. export FOO="abc=def=ghi".
  2. In devcontainer.json: "containerEnv": { "FOO": "${localEnv:FOO}" }.
  3. Open the folder in a Dev Container with Cursor, then run echo "$FOO" inside the container.
    • VS Code result: abc=def=ghi
    • Cursor result: abc (truncated at the first =).

Impact
Any secret/token/connection-string containing = (Atlassian API tokens, base64 values with = padding, some JWTs, DB connection strings) is silently corrupted when passed into a Dev Container via Cursor. This is hard to diagnose because the value looks “present but invalid,” and interactive terminals inside the container can appear fine while background/MCP processes get the corrupted value.

Please let me know if you need additional logs (Cursor server logs, devcontainer.json, or a screen recording of the minimal repro). Happy to help reproduce.

Thanks,
Fabian

Operating System

Windows 10/11

Version Information

  • Cursor on Windows + WSL2 (Ubuntu), Dev Containers with Docker-outside-of-Docker.
  • Cursor server build: 4f02290ccd9304f0e6bf8ee85f6e9106f02ac1f0
  • The variable is an Atlassian API token (BITBUCKET_TOKEN) of the form ATATT...<body>=<8-char checksum>, i.e. it legitimately contains a single = near the end.

Does this stop you from using Cursor

Yes - Cursor is unusable

What you’re seeing isn’t intended behavior, and it isn’t caused by your configuration — the host env parser used for WSL, Remote SSH and Dev Containers is currently splitting each line at the first =, so any = character inside a value gets dropped along with everything after it. We’ve let the team know and this is an issue we’re tracking.

Until an update lands, the simplest workaround is to keep the token off localEnv and pass it in on the container side instead. Either:

  1. Use --env-file — write BITBUCKET_TOKEN=… to a .env file on the host and add "runArgs": ["--env-file", "/absolute/path/to/.env"] to devcontainer.json (Docker respects the full value verbatim, no re-parsing on our side), or
  2. Mount it as a file and read inside — put the token in a file on the host, mount it read-only into the container, and export BITBUCKET_TOKEN="$(cat /run/secrets/bb-token)" in postStartCommand or your shell rc.

Both keep the full value intact. I’ll post here as soon as I have an update.