Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Terminal commands consistently start hanging after extended Cursor sessions, requiring IDE restart to resolve.
Steps to Reproduce
- Use Cursor for an extended session (typically several hours or overnight)
- Attempt to run any terminal command through Cursor’s integrated terminal
- Commands hang indefinitely
- Parse error visible when opening terminal panel:
/private/var/folders/.../T/rtkendall-cursor-zsh/.zshrc:51: parse error near 'unset'
Expected Behavior
Terminal commands should execute normally regardless of session length.
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 1.7.44 (Universal)
VSCode Version: 1.99.3
Commit: 9d178a4■■■89981b62546448bb32920a8219a5d0
Date: 2025-10-10T15:43:37.500Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.6.0
For AI issues: which model did you use?
Sonnet 4
Additional Information
The AI agent diagnosed the problem and found the root cause:
Root Cause Discovered
Corruption in Cursor’s temporary shell configuration file:
/private/var/folders/.../T/rtkendall-cursor-zsh/.zshrc
Technical Details
The corruption occurs in Cursor’s environment variable management code:
if [ -n "${VSCODE_ENV_REPLACE:-}" ]; then
IFS=':' read -rA ADDR <<< "$VSCODE_ENV_REPLACE"
for ITEM in "${ADDR[@]}"; do
VARNAME="$(echo ${ITEM%%=*})"
export $VARNAME="$(echo -e ${ITEM#*=})"
done
unset VSCODE_ENV_REPLACE # <-- Parse error occurs around here
fi
Diagnostic Script Created
I’ve created a script to detect this corruption:
#!/bin/bash
CURSOR_TEMP_DIR="/private/var/folders/.../T/rtkendall-cursor-zsh"
ZSHRC_FILE="$CURSOR_TEMP_DIR/.zshrc"
if [ ! -f "$ZSHRC_FILE" ]; then
echo "✅ No Cursor temp .zshrc found"
exit 0
fi
if ! zsh -n "$ZSHRC_FILE" 2>/dev/null; then
echo "🚨 Corrupted Cursor .zshrc detected!"
echo "📁 Location: $ZSHRC_FILE"
zsh -n "$ZSHRC_FILE"
exit 1
else
echo "✅ Cursor temp .zshrc is healthy"
fi
Why This Looks Like a Cursor Bug
-
Cursor-owned files getting corrupted: The corruption happens in
/private/var/folders/.../T/rtkendall-cursor-zsh/.zshrc- a file that Cursor creates and manages -
Consistent pattern: Happens reliably after extended Cursor sessions across multiple days
-
Always fixed by restart: Restarting Cursor regenerates clean temp files, which shouldn’t be necessary if the files were stable
-
Environment variable management code: The corruption specifically affects VSCODE_ENV_* variables and unset commands that Cursor uses for shell integration
What’s Likely Happening
Cursor probably has a bug in how it:
- Updates environment variables during long sessions
- Writes to its temporary shell configuration files
- Manages shell state over time
The temp .zshrc should remain stable once created, but something is corrupting it progressively.
Impact
This significantly disrupts development workflow as terminal commands become unusable, requiring frequent IDE restarts.
Additional Notes
- The temporary directory path includes the username, suggesting per-user temp files
- Corruption builds up gradually over extended sessions
- Only affects Cursor’s managed shell files, not user’s actual
.zshrc
Does this stop you from using Cursor
No - Cursor works, but with this issue