PowerShell Command Execution Bug in Cursor IDE (Composer - Agent)
PowerShell Command Execution Bug in Cursor IDE
Description
Commands executed through Cursor's terminal interface are failing due to an invalid PowerShell parameter being automatically prepended to commands.
Environment
- OS: Windows 10.0.26100
- Shell: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
- Cursor Version: 0.45
Issue Details
When attempting to execute any terminal command in Cursor, the IDE incorrectly prepends a -l parameter to PowerShell commands, which is not a valid PowerShell parameter. This appears to be a confusion between Linux shell parameters (where -l is valid) and Windows PowerShell parameters.
Error Message
The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe '-l'" terminated with exit code: 1
Reproduction Steps
- Open Cursor IDE
- Attempt to execute any terminal command (e.g.,
echo "Hello World",dir,pwd) - Observe that all commands fail with exit code 1
Expected Behavior
- Terminal commands should execute normally without the
-lparameter being prepended - Commands that work in standard PowerShell should work within Cursor
Actual Behavior
- All commands fail with exit code 1
- The
-lparameter is being automatically prepended to the PowerShell process - No command output is displayed
Additional Context
- All commands work correctly when executed outside of Cursor in a standard PowerShell terminal
- This appears to be an IDE-level issue rather than a system-wide PowerShell restriction
- The bug affects all types of commands (both PowerShell and cmd commands)
- I am able to run the commands given by the cursor tool in a separate terminal just fine
Impact
This bug prevents any terminal command execution within Cursor, significantly impacting development workflow that requires command-line operations.
Hi @mhills8 ,
Have you found a solution to this yet?
Hey @thangk ,
No I have not.
You should try to install powershell 7.
You should try to install powershell 7.
I'll give that a try. Thanks for the tip.
Bump, I have the same problem. Truly a super annoying bug, and should be easily fixable. Just tell us where to configure where the calls to the terminal are made.
Bump, I have the same problem. Truly a super annoying bug, and should be easily fixable. Just tell us where to configure where the calls to the terminal are made.
I upgraded to PowerShell 7 and set that as default in Cursor. I funk that solved my issue. I am able to execute commands from the prompt results now.
deepseek told me to make the settings.json file like this and the error was solved, you can copy paste it directly: { "python.createEnvironment.trigger": "off", "tabnine.experimentalAutoImports": true, "diffEditor.maxComputationTime": 0, "terminal.integrated.defaultProfile.windows": "Command Prompt", "terminal.integrated.profiles.windows": { "PowerShell": { "path": "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe", "args": [], "icon": "terminal-powershell" }, "Command Prompt": { "path": "cmd.exe", "args": [], "icon": "terminal-cmd" }, "Git Bash": { "source": "Git Bash" } }, "roo-cline.allowedCommands": [ "npm test", "npm install", "tsc", "git log", "git diff", "git show", "python", "pip", "pip install", "npm run", "npm", "pnpm install", "cd", "npx", "Always approve execute operations", "pnpm run", "pnpm", "pnpm add", "pytest" ], "aider-composer.pythonPath": "C:\Python312\python.exe", "cursor.terminal.usePreviewBox": true, "cursor.composer.cmdPFilePicker2": true, "cursor.composer.collapsePaneInputBoxPills": true, "cursor.composer.shouldShowMarkdownHoverParticipantActions2": true, "terminal.explorerKind": "external" }
just update powershell version to the v7 easily with winget support just search on google for powershell update with winget and you can find that
Bump, I have the same problem. Truly a super annoying bug, and should be easily fixable. Just tell us where to configure where the calls to the terminal are made.
I upgraded to PowerShell 7 and set that as default in Cursor. I funk that solved my issue. I am able to execute commands from the prompt results now.
The biggest issue with this is that the azuread module doesn't support powershell core edition.
This module does not support PowerShell Core edition. Retry the operation with PowerShell Desktop edition (Windows PowerShell).
same here on Macbook Pro M2. lost 80% (money. and most important - time , from limits into pro account.
Same, 5 tokens gone. 😢
I'm on the 0.48.9 (user setup) and still have this issue.
powershell > agi
terminal.integrated.defaultProfile.osx: zsh
I think they do this on purpose to make more money off all the additional requests.. Why else would this issue still be a problem when the simple fact that you downloaded the Windows version from their site?
Ask your Cursor agent to create a "Powershell MCP Server" that is not project specific. Add Cursor User AI rules on how to use the MCP server, your agent will create these.
Works beautifully in all new projects.