Yesterday, I installed the STM32 programming environment with assistance from Cursor.
It seems that Cursor did not correctly manage the existing environment variables. Rather than appending to the existing entries, it created new ones, which may have caused conflicts or loss of prior configurations.
Steps to Reproduce
The exact steps to reproduce the issue are unclear. I primarily relied on Cursor to assist with installing the STM32 environment, and the problem seems to have occurred during this automated setup process.
What happened here: during the STM32 environment setup, the AI model generated a command, most likely setx PATH "...", that overwrote your PATH completely instead of appending to it. Cursor doesn’t modify PATH directly, this is done by terminal commands generated by the model.
What you can do now:
Restore PATH: if you have a System Restore Point, you can roll back environment variables. Or manually add the missing entries via System Properties > Environment Variables.
Turn off Auto-run mode if it’s enabled: Cursor Settings > agents > turn off “Auto-run mode”. This makes the agent ask for confirmation before every terminal command, so you can review what it’s about to run.
Always review commands before confirming, especially setx, reg add, and other commands that change system settings.
The team is aware of this class of issues. There’s no specific ETA, but your report helps with prioritization.
Let me know if you were able to restore your PATH.
I wanted to add that I manually proceeded with the changes at the time, and I understand the potential risks involved—I’m able to take responsibility for the outcome. My intention in reporting this is mainly to surface the issue so your team is aware of it, especially since it could affect other users who might not notice what’s happening.
Appreciate the guidance on restoring PATH and the suggestions around Auto-run mode. I’ll be more cautious with system-level commands going forward.