On my Mackbook Pro Max 16 2023
I am getting errors from Composer. this happens when it wants to execute a command on the CLI.
I am not sure why this is happening. I did install xcode and wondering if this caused something to break. Please let me know.
Exception
System.InvalidOperationException: Cannot locate the offset in the rendered text that was pointed by the origi
nal cursor. Initial Coord: (42, 18) Buffer: (109, 19) Cursor: (43, 0)
at Microsoft.PowerShell.PSConsoleReadLine.RecomputeInitialCoords(Boolean isTextBufferUnchanged)
at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(PSKeyInfo key, Dictionary2 dispatchTable, Boolean ignoreIfNoAction, Object arg) at Microsoft.PowerShell.PSConsoleReadLine.InputLoop() at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, C ancellationToken cancellationToken, Nullable1 lastRunStatus)
Issue: Cursor IDE’s run_terminal_cmd Tool Defaults to PowerShell on macOS Despite System Shell Being zsh
When the AI Assistant (Claude) attempts to execute commands using the run_terminal_cmd tool, it incorrectly defaults to PowerShell despite the system being configured to use zsh. This creates issues when running shell-dependent commands and scripts.
Steps to Reproduce:
Open Cursor IDE on macOS
Verify system shell is zsh (echo $SHELL returns /usr/local/bin/zsh)
Ask the AI Assistant to execute a command using run_terminal_cmd
Observe the command execution output
Expected Behavior:
The run_terminal_cmd tool should respect the system’s default shell (zsh) when executing commands on macOS.
I’m having similar issues. I thought it was because I had PowerShell installed on my MBP, so I removed it and the VSCode Poweshell extension, but it didn’t solve the issue.
Adding the following to the Rules for AI field in the Cursor Settings seems to help; it now always opens a new terminal pane and runs the commands there.
Always use the default OS terminal over Powershell for running commands, except if it’s on a Windows machine
But it would be nice if it did that in the Cursor agent instead of the new terminal pane.
Yup, that worked on my M1 MacBook. I was also able to get it to stop asking me to install PowerShell on my Ubuntu workstation using a similar set of settings
Every time. I clicked the settings ICON and in the AI RULES added:
- Always use the default OS terminal over Powershell for running commands, except if it’s on a Windows machine
"terminal.integrated.automationProfile.linux": {},
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.shellIntegration.enabled": false
Yup, that worked on my M1 MacBook. I was also able to get it to stop asking me to install PowerShell on my Ubuntu workstation using a similar set of settings
Circling back here, while it does seem to work, it runs a different terminal from my OS terminal. So I have node v 20 installed on my OS, but the version running in Cursor is only 16