Cursor AI Uses Incorrect Command Separator in Agent Mode on PowerShell

Description:

I’m encountering a recurring issue when using Cursor AI in Agent Mode on my Windows 11 system. When running commands in the default PowerShell, the agent consistently uses the && symbol as a separator between commands. This is problematic because && is not a valid syntax for command chaining in PowerShell 5.1, which comes pre-installed on Windows. The correct syntax should use a semicolon (;) instead.

Problem Details:

  • Context: Running commands in the default PowerShell on Windows 11 using Cursor AI in Agent Mode.

  • Issue: The AI repeatedly uses && to separate commands despite specifying in the system prompt to avoid it.

  • Impact:

    • Causes command failures and forces unnecessary retries.
    • Results in increased API usage and wasted credits.
    • Generates additional load on Cursor and Claude servers due to failed command executions.
  • Attempts to Fix:

    • Modified system prompts to explicitly state not to use &&.
    • Despite multiple reminders and prompt adjustments, the issue persists.

Suggested Improvement:
Implement a backend fix to automatically replace && with ; when generating PowerShell commands on Windows systems. This would improve user productivity and reduce unnecessary resource utilization on both the client and server sides.

idk maybe other solutions exist as well.

This issue significantly hampers the practical usability of Cursor AI on Windows and makes it less efficient for automated tasks and scripting. Any insights or updates on a potential fix would be greatly appreciated.

cc: @truell20 @ericzakariasson, would appreciate if you guys can look into this!