Terminal Commands Fail Due to Shell Integration Error on Windows 11 (Cursor 0.46.8)

  • :white_check_mark: Check the forum: I have searched the forum and did not find an existing report on this behavior.
  • :lady_beetle: Bug description:
    The Cursor composer and chat are unable to run terminal commands. When attempting to run a command (e.g., using echo "hi"), I receive an error indicating that shell integration failed to activate. The terminal displays the following message:
echo "hi"

Process ID (PID): 31164

Command line: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe '-l' '-noexit' '-command' 'try { . "c:\Users\myusername\AppData\Local\Programs\cursor\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1" } catch {}'

Shell integration failed to activate
  • :counterclockwise_arrows_button: Reproduction steps:
    1. Open Cursor on Windows 11.
    2. Open the integrated terminal (configured to use the “PowerShell Python Env” profile).
    3. Execute a simple command (e.g., write echo "hi" in terminal).
    4. Observe that instead of executing the command normally, the terminal shows the above error regarding shell integration.
  • :camera: Screenshots/recordings:



  • :laptop: Operating system & Cursor version:
    • Operating System: Windows 11
    • Cursor Version: 0.46.8
  • :prohibited: Impact:
    This issue prevents the use of terminal commands within Cursor’s composer and chat, significantly affecting my workflow.

Additional Configuration Details:

{
  "terminal.integrated.defaultProfile.windows": "PowerShell Python Env",
  "terminal.integrated.useWslProfiles": false,
  "terminal.integrated.profiles.windows": {
    "PowerShell Python Env": {
      "path": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
      "args": [
        "-NoExit",
        "-Command",
        "& {",
        "cd '${workspaceFolder}';",
        "if (Test-Path -Path .\\venv) { . .\\venv\\Scripts\\Activate.ps1 }",
        "}"
      ],
      "icon": "terminal-powershell"
    }
  }
}

I’ve tried several tweaks to my terminal settings (both locally and within Cursor) without success. Any assistance in resolving this shell integration issue would be greatly appreciated.

1 Like

The same sheet.
I went through app files and found two places where this arg is added:

%USERPROFILE%\AppData\Local\Programs\cursor\resources\app\out\vs\platform\terminal\node\ptyHostMain.js
%USERPROFILE%\AppData\Local\Programs\cursor\resources\app\out\main.js

So, I replaced strings "-l","-noexit" with "-noexit" in both files and restart Cursor.AI.
The solution will work until the next update.

2 Likes

Thanks i had same issue and this worked. will wait till cursor team fix this

Still the same issue even after latest update, keeping this thread alive as its pretty ridiculous you cant use agent mode to run terminal commands in powershell.

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