PowerShell Terminal Integration Issues in Cursor AI

Environment

  • OS: Darwin 24.4.0 (macOS)
  • PowerShell: 7.4.1
  • PSReadLine: 2.3.4
  • Shell: /bin/zsh
  • Workspace: /Users/jlcases/codigo/deepthinkerio-old

Issue Description

Experiencing consistent PowerShell integration issues in Cursor AI. Any terminal command execution results in cursor positioning errors.

  1. Core Issue

    • All terminal commands fail with PowerShell cursor positioning errors
    • Issue appears to be with PowerShell’s terminal rendering
    • Affects all command execution attempts regardless of the command type
  2. Error Pattern
    Consistently getting the same PowerShell error:

    System.InvalidOperationException: Cannot locate the offset in the rendered text that was pointed by the original cursor.
    Initial Coord: (44, 12) Buffer: (164, 13) Cursor: (45, 9)
    at Microsoft.PowerShell.PSConsoleReadLine.RecomputeInitialCoords(Boolean isTextBufferUnchanged)
    
  3. Context

    • Issue occurs in Cursor’s AI interface
    • Using the run_terminal_cmd tool
    • PowerShell seems to be intercepting all terminal interactions
    • No actual command output is being received

Expected Behavior

  • Terminal commands should execute normally
  • Should receive command output rather than PowerShell errors
  • Terminal integration should work with both PowerShell and zsh

Questions

  1. Is this a known issue with PowerShell integration in Cursor?
  2. Are there specific settings needed for terminal integration?
  3. Is there a recommended workaround for this PowerShell rendering issue?
  4. Should terminal integration be configured differently?

Additional Information

The error suggests a fundamental issue with PowerShell’s cursor positioning and terminal rendering in the AI environment, rather than with specific commands.

Steps to Reproduce

  1. Use Cursor AI
  2. Attempt to execute any terminal command
  3. Observe PowerShell cursor positioning errors instead of command output

Would appreciate guidance on resolving this PowerShell integration issue.

9 Likes

Did you get any answers? I am also facing some troubles with my Powershell connection.

1 Like

I get the same error messages here. I’m interested in what powershell’s roll in that command is? I’m a mac user and was unaware I even had powershell?

1 Like

No answers… Cursor needs a community manager :slight_smile:

1 Like

I have upgraded to Powershell 7.4.7 because of other issues. Coming from OSX Unix, I have to say, Powershell is not my favorite.

PowerShell 7.5.0 is considered stable but I opted for the final 7.4 series release.

Releases · PowerShell/PowerShell

Its not really a cusor problem, its up to us to twiddle with the operating systems and its configuration.

1 Like

For sure, agree with you

cursor should be easily configured to use alternate shells for execution. git bash should work perfectly on windows.

2 Likes

Many thanks

I don’t get it, what is the solution?

I installed the latest version of Powershell , and now its working well.

This resolved the issue for me.

"terminal.integrated.defaultProfile.osx": "zsh"

I have now migrated to PowerShell 7.5 via this link and all my problems are solved - including it set Windows Update as integrated the Powershell releases into its duties.

https://github.com/PowerShell/PowerShell/releases/download/v7.5.0/PowerShell-7.5.0-win-x64.msi

This issue is really frustrating, because it makes Cursor IDE much less useful.

I have many tools installed through my powershell profile, so changing "terminal.integrated.defaultProfile.osx": "zsh" means those tools aren’t set up right, and it’s annoying needing to manually switch my terminal to pwsh. And Cursor wouldn’t be able to help me with powershell live scripting.

I thought there would be the same bug in vscode, but their Agent mode runs things in the normal Terminal window, so this bug is just in how Cursor creates/resizes the Chat dynamic terminal!

Go ahead and give Exception on Linux when pasting with `CTRL+SHIFT+V` · Issue #4682 · PowerShell/PSReadLine · GitHub an upvote – maybe this can be fixed on the shell side?

It seems that Powershell 7.5 is working better for me, too, on Windows (obviously). It SEEMS to be seeing the command is over and getting the output. I had to install PS 7.5, add it to the cursor integrated editors and also restart cursor. That last was important.

Some commands run in the chat, and either they stay there or I do the “Open in Terminal” so get a full pane outside the chat. Both seem to be working. I ran all my linter runs, builds and test case execution both in the chat and in the external(ish) terminal pane. All seemed to work. I’d recommend trying this out if you’re having issues.

EDIT: Okay – it’s BETTER, but still sometimes hangs. Not as much, though.

Yeah, I’m wrong. It still ■■■■■ majorly. Restarting the app seems to help, but only for a short time. I don’t understand why, honestly, the cursor team isn’t fixing this? I’ve tried just about every shell I can think of, they all have the problem. This is honestly becoming tiresome. Like… sure, I can spend my monthly money (of which it says I’m at 2%, so clearly I’m not a burdensome user), but if I can’t use it, then my money is pretty much wasted. Old boss is trying to convince me to go to Claude Code.