Agent shell broken after update — PowerShell wrapper script parsing error

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Environment:
Cursor version: (2.4.37)
OS: Windows 10 (10.0.19045)
Shell: Windows PowerShell 5.1
No PowerShell profile exists ($PROFILE path does not exist)
Description:
After updating Cursor, the agent’s shell tool is completely broken. Every command — including simple ones like echo hello — fails before execution. The error comes from Cursor’s own generated wrapper script (ps-script-*.ps1), not from the user command.
The issue affects the agent shell only. The integrated terminal may work fine.

Steps to Reproduce

Open any workspace on Windows 10 with PowerShell 5.1 as the default shell
Start an Agent conversation
Ask the agent to run any shell command (e.g., echo hello)
The command fails immediately
Error output:
At C:\Users\User\AppData\Local\Temp\ps-script-GUID.ps1:34 char:134+ … coding]::UTF8.GetString([System.Convert]::FromBase64String(‘’{1}‘’))) …+ ~Missing ‘)’ in method call.At C:\Users\User\AppData\Local\Temp\ps-script-GUID.ps1:49 char:20+ Emit (‘Set-Alias -Name “{0}” -Value “{1}”’ -f $alias.Name …+ ~~~~~~~~~Unexpected token ‘Set-Alias’ in expression or statement. + CategoryInfo : ParserError: (:slight_smile: , ParentContainsErrorRecordException + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall
What I’ve tried (none fixed it):
Restarting Cursor
Changing terminal.integrated.defaultProfile.windows to Command Prompt
Verified no PowerShell profile exists (Test-Path $PROFILE returns False)
Deleting temp ps-script-*.ps1 files

Expected Behavior

Agent shell commands should execute normally.
Workaround: None for the agent shell. Running commands manually in an external terminal works.

Operating System

Windows 10/11

Version Information

Version: 2.4.37 (user setup)
VSCode Version: 1.105.1
Commit: 7b9c34466f5c119e93c3e654bb80fe9306b6cc70
Date: 2026-02-12T23:15:35.107Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Windows_NT x64 10.0.19045

Does this stop you from using Cursor

No - Cursor works, but with this issue

PS:
it worked well on the 13/2/26 but after Cursor update in 14/2/26 the error occurred.

Hey, thanks for the report. This looks like a new regression in the PowerShell wrapper script after the 2.4.37 update. There’s a similar bug here Bug Report: PowerShell Commands Fail with “Duplicate Key” Error in Wrapper Script where the wrapper script also fails during processing.

Try this workaround:

  1. Cursor Settings Ctrl+Shift+J
  2. Agents > Legacy Terminal Tool > enable it
  3. Ctrl+Shift+P > Terminal: Kill All Terminals
  4. Fully restart Cursor
  5. Try the command again

Legacy Terminal Tool uses the older implementation, which can avoid the bug in the new wrapper script.

If that doesn’t help, I’ll need a bit more info to escalate this to the team:

  • Can you share the contents of the failing ps-script file? (It’s in C:\Users\User\AppData\Local\Temp\ps-script-*.ps1, grab the most recent one)
  • What exact command was the agent trying to run when the error showed up?

Let me know how it goes.

thanks for the quick reply
it’s working well now.

The shell is fully working again. The Legacy Terminal Tool workaround solved the PowerShell wrapper issue.

1 Like