cursor icon indicating copy to clipboard operation
cursor copied to clipboard

PowerShell Command Execution Bug in Cursor IDE (Composer - Agent)

Open mhills8 opened this issue 1 year ago • 13 comments

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

  1. Open Cursor IDE
  2. Attempt to execute any terminal command (e.g., echo "Hello World", dir, pwd)
  3. Observe that all commands fail with exit code 1

Expected Behavior

  • Terminal commands should execute normally without the -l parameter being prepended
  • Commands that work in standard PowerShell should work within Cursor

Actual Behavior

  • All commands fail with exit code 1
  • The -l parameter 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.

mhills8 avatar Feb 08 '25 16:02 mhills8

Hi @mhills8 ,

Have you found a solution to this yet?

thangk avatar Feb 23 '25 16:02 thangk

Hey @thangk ,

No I have not.

mhills8 avatar Feb 24 '25 14:02 mhills8

You should try to install powershell 7.

eliasdn avatar Feb 25 '25 17:02 eliasdn

You should try to install powershell 7.

I'll give that a try. Thanks for the tip.

thangk avatar Feb 25 '25 17:02 thangk

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.

frotaur avatar Mar 02 '25 23:03 frotaur

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.

thangk avatar Mar 02 '25 23:03 thangk

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" }

fukobaba7 avatar Mar 04 '25 19:03 fukobaba7

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

rutulpatel07 avatar Mar 14 '25 18:03 rutulpatel07

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).

bitslingio avatar Mar 18 '25 02:03 bitslingio

same here on Macbook Pro M2. lost 80% (money. and most important - time , from limits into pro account.

ikakey avatar Apr 03 '25 11:04 ikakey

Same, 5 tokens gone. 😢

EunHyeokJung avatar Apr 16 '25 06:04 EunHyeokJung

I'm on the 0.48.9 (user setup) and still have this issue.

mateuszfryc avatar Apr 18 '25 15:04 mateuszfryc

powershell > agi

terminal.integrated.defaultProfile.osx: zsh

id-2 avatar Apr 22 '25 05:04 id-2

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?

Wavfact avatar Apr 30 '25 20:04 Wavfact

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.

euphoriaman avatar May 25 '25 14:05 euphoriaman