Agent/Model Tries Using PowerShell Commands when Cmd is the Default Terminal

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When Cmd is the default terminal, the Agent isn’t properly detecting that and reporting it to the model, so the model tries using PowerShell specific commands and syntax, which result in errors in Cmd.

This was confirmed as a known bug in the following reply, but I’m creating a separate post for visibility to other users and so we can track progress on getting it resolved:

Similar behavior is also mentioned in the following old posts, but no resolution was provided:

Steps to Reproduce

The bug is intermittent, but you set your default terminal to Cmd and start an agent prompt that will trigger calls to the terminal tool. The model may try to use PowerShell commands and syntax, resulting in an error.

Expected Behavior

The agent correctly reports which terminal is active (i.e. Cmd), and the model never tries to run commands that will only work in a different terminal (i.e. PowerShell).

Operating System

Windows 10/11

Version Information

Version: 2.6.18 (system setup)
VSCode Version: 1.105.1
Commit: 68fbec5aed9da587d1c6a64172792f505bafa250
Date: 2026-03-10T02:01:17.430Z
Build Type: Stable
Release Track: Default
Electron: 39.6.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26100

For AI issues: which model did you use?

Sonnet and Opus, but likely other models as well.

For AI issues: add Request ID with privacy disabled

I can’t disable privacy on my company managed team account.

Additional Information

This bug not only increases the processing time of the prompt, the erroneous terminal tool call also results in more cache read token sage, which increases the cost of the prompt. See also:

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for making a separate post so it’s easier to see. This is a known bug. On Windows, the agent’s shell detection defaults to PowerShell no matter what terminal profile you’ve set.

Your .cursor/rules workaround is the best option right now:

When running terminal commands, always use cmd.exe syntax, not PowerShell. The default shell is Command Prompt.

The team knows about the issue. There’s no ETA for a fix yet, but your report and the others you linked help us prioritize it.

Let me know if the rules workaround still isn’t enough.

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