Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
When the Cursor agent runs a shell command, the command does not complete. Under WSL2, ps shows many nested processes, all running the same wrapped command line. The process tree grows until the environment is saturated and WSL crashes due to out of memory.
Reproduction is not limited to one tool (e.g. a linter). The same behavior occurs with simple shell pipelines (e.g. find + wc), which indicates a problem in agent/sandbox shell execution, not project-specific tooling.
I cannot allow cursor agents to run ANY commands
Example process tree (anonymized):
user@host:~$ ps -ef | grep extglob
user 1001 900 0 13:03 ? 00:00:00 /bin/bash -O extglob -c snap=$(command cat <&3) && builtin shopt -s extglob && builtin eval -- "$snap" && { builtin set +u 2>/dev/null || true; builtin eval "${__CURSOR_SANDBOX_ENV_RESTORE:-}" 2>/dev/null; builtin export PWD="$(builtin pwd)"; builtin shopt -s expand_aliases 2>/dev/null; builtin eval "$1"; }; COMMAND_EXIT_CODE=$?; dump_bash_state >&4; builtin exit $COMMAND_EXIT_CODE -- cd <REPO_ROOT> && timeout 30 yarn run eslint <PATH_TO_FILE> 2>&1; echo "exit=$?"
user 1101 1001 0 13:03 ? 00:00:00 /home/user/.cursor-server/bin/<CURSOR_SERVER_BUILD>/resources/helpers/cursorsandbox --policy /tmp/sandbox-policy-<ID> -- /bin/bash -O extglob -c snap=$(command cat <&3) && builtin shopt -s extglob && builtin eval -- "$snap" && { builtin set +u 2>/dev/null || true; builtin eval "${__CURSOR_SANDBOX_ENV_RESTORE:-}" 2>/dev/null; builtin export PWD="$(builtin pwd)"; builtin shopt -s expand_aliases 2>/dev/null; builtin eval "$1"; }; COMMAND_EXIT_CODE=$?; dump_bash_state >&4; builtin exit $COMMAND_EXIT_CODE -- cd <REPO_ROOT> && timeout 30 yarn run eslint <PATH_TO_FILE> 2>&1; echo "exit=$?"
user 1201 1001 0 13:03 ? 00:00:00 /bin/bash -O extglob -c snap=$(command cat <&3) && builtin shopt -s extglob && builtin eval -- "$snap" && { builtin set +u 2>/dev/null || true; builtin eval "${__CURSOR_SANDBOX_ENV_RESTORE:-}" 2>/dev/null; builtin export PWD="$(builtin pwd)"; builtin shopt -s expand_aliases 2>/dev/null; builtin eval "$1"; }; COMMAND_EXIT_CODE=$?; dump_bash_state >&4; builtin exit $COMMAND_EXIT_CODE -- cd <REPO_ROOT> && timeout 30 yarn run eslint <PATH_TO_FILE> 2>&1; echo "exit=$?"
user 1202 1201 0 13:03 ? 00:00:00 /bin/bash -O extglob -c snap=$(command cat <&3) && builtin shopt -s extglob && builtin eval -- "$snap" && { builtin set +u 2>/dev/null || true; builtin eval "${__CURSOR_SANDBOX_ENV_RESTORE:-}" 2>/dev/null; builtin export PWD="$(builtin pwd)"; builtin shopt -s expand_aliases 2>/dev/null; builtin eval "$1"; }; COMMAND_EXIT_CODE=$?; dump_bash_state >&4; builtin exit $COMMAND_EXIT_CODE -- cd <REPO_ROOT> && timeout 30 yarn run eslint <PATH_TO_FILE> 2>&1; echo "exit=$?"
user 1203 1202 0 13:03 ? 00:00:00 /bin/bash -O extglob -c snap=$(command cat <&3) && builtin shopt -s extglob && builtin eval -- "$snap" && { builtin set +u 2>/dev/null || true; builtin eval "${__CURSOR_SANDBOX_ENV_RESTORE:-}" 2>/dev/null; builtin export PWD="$(builtin pwd)"; builtin shopt -s expand_aliases 2>/dev/null; builtin eval "$1"; }; COMMAND_EXIT_CODE=$?; dump_bash_state >&4; builtin exit $COMMAND_EXIT_CODE -- cd <REPO_ROOT> && timeout 30 yarn run eslint <PATH_TO_FILE> 2>&1; echo "exit=$?"
user 1204 1203 0 13:03 ? 00:00:00 /bin/bash -O extglob -c snap=$(command cat <&3) && builtin shopt -s extglob && builtin eval -- "$snap" && { builtin set +u 2>/dev/null || true; builtin eval "${__CURSOR_SANDBOX_ENV_RESTORE:-}" 2>/dev/null; builtin export PWD="$(builtin pwd)"; builtin shopt -s expand_aliases 2>/dev/null; builtin eval "$1"; }; COMMAND_EXIT_CODE=$?; dump_bash_state >&4; builtin exit $COMMAND_EXIT_CODE -- cd <REPO_ROOT> && timeout 30 yarn run eslint <PATH_TO_FILE> 2>&1; echo "exit=$?"
This repeats until the available memory is used up.
Steps to Reproduce
Open a local project workspace in Cursor on WSL2 (any medium-sized tree is enough).
Ask the agent to run either of the commands below (or run them through the agent shell integration).
Observe: the command does not return; process count / load grows.
In a normal WSL terminal, run: ps -ef | grep extglob (or pstree -p on the top-level PID).
Reproduction commands (masked / generic)
A — Node toolchain (example):
cd <REPO_ROOT> && yarn run <SOME_NPM_SCRIPT_OR_BINARY> <PATH_TO_SINGLE_FILE> 2>&1
B — Not toolchain-specific (filesystem only):
cd <REPO_ROOT> && timeout 60 find <SOME_SUBDIR> -type f ( -name ‘.ts’ -o -name '.tsx’ -o -name '*.
Replace <REPO_ROOT> with any project path, <SOME_SUBDIR> with a real subdirectory under that repo, and <PATH_TO_SINGLE_FILE> / <SOME_NPM_SCRIPT_OR_BINARY> with any valid file and script that would normally finish quickly in a normal terminal.
Expected Behavior
The command should finish instantly or in a few seconds
Operating System
Windows 10/11
Version Information
Linux OPHD-3206 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu 24.04.4 LTS
Version: 3.1.14 (user setup)
VSCode Version: 1.105.1
Commit: d8673fb56ba50fda33ad78382000b519bb8acb70
Date: 2026-04-14T01:39:23.679Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200
Additional Information
I have tried rebuilding my WSL+Ubuntu install from scratch, as well as reinstalling Cursor. I have deleted every cursor-related file I could find.
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor