Agent unable to run commands on Windows 11

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I am seeking help to get the Cursor Agent working on my machine. Currently, the Agent (running Gemini 3 Pro / GPT-5.1) cannot execute any terminal command. Every attempt fails immediately with a PowerShell syntax error originating from the internal wrapper script (ps-script-…ps1) that Cursor generates to execute the command.Environment:
• OS: Windows 11 (Build 10.0.26200)
• Cursor Version: 2.0.77
• Shell: PowerShell 5.1 & Command Prompt
• Locale/System Language: Russian (likely causing encoding issues in the generated script)
The Issue:When the Agent tries to run a command (e.g., simple echo test), the operation crashes with the following output:
"C:\Users...\AppData\Local\Temp\ps-script-[UUID].ps1:34 char:134

  • … coding]::UTF8.GetString([System.Convert]::FromBase64String(‘’{1}‘’))) …
  •          ~Missing closing ')' in method call.
    


C:\Users...\AppData\Local\Temp\ps-script-[UUID].ps1:49 char:54

  • … it (‘Set-Alias -Name “{0}” -Value “{1}”’ -f $alias.Name, $definition)
  •                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

The string is missing the terminator: '.
+ CategoryInfo : ParserError: ( : ) , ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingEndParenthesisInMethodCall"

The error output also contains garbled characters (mojibake), suggesting a severe encoding mismatch between the Agent’s script generation and the local PowerShell execution.What I have already tried (but failed):

  1. Cleaning the Environment: I removed my PowerShell profile, deleted all custom aliases, and unloaded all non-standard functions (including VS Code internal helpers and oss). The Env variables and PATH are clean (no unescaped quotes).
  2. Switching Shells: I changed “terminal.integrated.defaultProfile.windows” to “Command Prompt”. I can use cmd manually, but the Agent still forces execution via the broken PowerShell wrapper script.
  3. Forcing UTF-8: I tried launching PowerShell with -Command “$OutputEncoding = … New-Object System.Text.UTF8Encoding” and running chcp 65001. The wrapper script still crashes with the same syntax error.
    Question:Has anyone encountered this specific ParserError with the Agent on Windows with non-English locales?Is there a way to:
  4. Force the Agent to use cmd.exe natively without wrapping commands in ps-script?
  5. Override the encoding used by the Agent’s internal terminal integration?
    Any advice on how to unblock the Agent would be appreciated.

Steps to Reproduce

Agent should run any commands in its terminal.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.0.77 (user setup)
VSCode Version: 1.99.3
Commit: ba90f2f88e4911312761abab9492c42442117cf0
Date: 2025-11-13T23:10:43.113Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

Gemini 3 pro, GPT-5.1

Does this stop you from using Cursor

No - Cursor works, but with this issue

1 Like

Hey, thanks for the report. This is a known issue with the new terminal implementation on Windows, and it especially affects non-English locales. The PowerShell wrapper script that Cursor generates runs into encoding problems with certain environment configurations.

Please try this workaround:

  1. Open Cursor Settings Ctrl+Shift+J
  2. Go to the Agents tab → find “Inline Editing & Terminal”
  3. Enable “Legacy Terminal Tool”
  4. Press Ctrl+Shift+P → select “Terminal: Kill All Terminals”
  5. Fully restart Cursor
  6. Test Agent commands again

To help engineering investigate:

You can also run ls env: in a PowerShell terminal and share the output here (you can hide any sensitive values). This will help the team understand which environment variables might be causing the encoding issue with the Russian locale.

Let me know if enabling the Legacy Terminal Tool helps.

2 Likes

Thank you so much! It really helped me solve the issue!

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.