# Agent terminal not respect the setting

**URL:** <https://forum.cursor.com/t/agent-terminal-not-respect-the-setting/161280>\
**Category:** Bug Reports\
**Created:** [May 22, 2026, 5:00am UTC](https://forum.cursor.com/t/agent-terminal-not-respect-the-setting/161280 "2026-05-22T05:00:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cy\_c](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@cy\_c](https://forum.cursor.com/u/cy_c)\
**Post date:** [May 22, 2026, 5:00am UTC](https://forum.cursor.com/t/agent-terminal-not-respect-the-setting/161280/1 "2026-05-22T05:00:29Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

I set up the pwsh v7, and also set the default terminal, this is work in windows and the terminal of cursor IDE, but the agent still using powershell v5, this lead the syntax of new powershell always error

### Steps to Reproduce

ask agent to use terminal, ask to use new syntax (e.g. &&) or print the version

### Expected Behavior

use the same pwsh of default terminal

### Operating System

Windows 10/11

### Version Information

Version: 3.5.17 (user setup)  
VSCode Version: 1.105.1  
Commit: d5b2fc092e16007956c9e5047f76097b9e626ca0  
Date: 2026-05-20T02:43:31.559Z  
Layout: editor  
Build Type: Stable  
Release Track: Nightly  
Electron: 39.8.1  
Chromium: 142.0.7444.265  
Node.js: 22.22.1  
V8: 14.2.231.22-electron.0  
OS: Windows\_NT x64 10.0.22631

### For AI issues: which model did you use?

auto

### For AI issues: add Request ID with privacy disabled

Request ID: a7b2513d-286e-4e01-9318-d88ed5aefe1c

### Additional Information

I config the pwsh v7 in windows as default, it is also default in terminal of cursor. but agent terminal still using old version of powershell v5.

I also try to set the global and project settings.json, enable lagacy terminal tool, and try different settings from other threads.

is it any approach to config the default terminal?

### Does this stop you from using Cursor

No - Cursor works, but with this issue

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [May 22, 2026, 5:43am UTC](https://forum.cursor.com/t/agent-terminal-not-respect-the-setting/161280/3 "2026-05-22T05:43:49Z")

</div>

Hey, thanks for the detailed report. This is a known bug: agent shell detection on Windows doesn’t respect `terminal.integrated.defaultProfile.windows` and picks a different shell than the one selected in the integrated terminal. There’s no ETA for a fix yet, but the issue is being tracked.

As a workaround, try explicitly limiting profiles to PowerShell 7 pwsh only and disabling the default `PowerShell` profile since it points to PS5. In your User `settings.json`:

```json
"terminal.integrated.defaultProfile.windows": "PowerShell",
"terminal.integrated.profiles.windows": {
    "PowerShell": {
        "source": "PowerShell",
        "icon": "terminal-powershell",
        "path": "C:\\Program Files\\PowerShell\\7\\pwsh.exe",
        "args": []
    },
    "Windows PowerShell": null,
    "Command Prompt": null
}

```

Adjust the `pwsh.exe` path if PowerShell 7 is installed somewhere else. You can check it with `(Get-Command pwsh).Source` in PowerShell 7.

After that, fully close Cursor using Quit, not Reload Window, then check in the agent:

```powershell
$PSVersionTable.PSVersion

```

If it’s still PS5, also check `where.exe powershell` and `where.exe pwsh` in a normal `cmd.exe`. Sometimes `powershell.exe` PS5 appears earlier in PATH than `pwsh.exe`, and the shell detector grabs it first. In that case, either move `C:\Program Files\PowerShell\7` higher in the System PATH, or keep only pwsh in PATH.

Let me know if that helps. If not, send the output of `where.exe powershell` and `where.exe pwsh` from `cmd`, and we’ll dig in.

---

<div class="post-metadata">

**Author:** ![cy\_c](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@cy\_c](https://forum.cursor.com/u/cy_c)\
**Post date:** [May 22, 2026, 6:35am UTC](https://forum.cursor.com/t/agent-terminal-not-respect-the-setting/161280/4 "2026-05-22T06:35:32Z")

</div>

Thanks for your help! after i set the pwsh on top of the path of system env, the agent able to call with pwsh v7

however, the root cause is that the terminal does not respect the ./.vscode/settings.json, in my case, i need to has a project based setup for pwsh with args, but now only following the global settings.json

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [May 22, 2026, 8:25am UTC](https://forum.cursor.com/t/agent-terminal-not-respect-the-setting/161280/5 "2026-05-22T08:25:25Z")

</div>

Glad pwsh 7 got picked up after you reworked your PATH.

About the agent terminal ignoring `./.vscode/settings.json` and only reading the global user `settings.json`, that’s part of the same Windows shell detection problem. The issue is already reported, I’ll add your case about workspace scoped settings and args to the existing ticket. I can’t share an ETA for a fix yet.

As a temporary workaround for project specific pwsh args, you can either launch Cursor from the project directory with an environment variable, or put the args in `$PROFILE` (PowerShell 7 profile) and branch inside it based on `$PWD`. It’s a hack, but it should let you keep per project behavior until the fix lands.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [June 21, 2026, 8:26am UTC](https://forum.cursor.com/t/agent-terminal-not-respect-the-setting/161280/6 "2026-06-21T08:26:03Z")

</div>

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