Terminal issues...again

Well you guys had the terminal issues squared away but now it looks like Cursor is completely ignoring the Legacy Terminal tool setting. I am guessing this is the issue because when I instruct Cursor to use custom aliases I have in my bashrc file, it says those commands are not found. When it tried to execute npm run build, I get a exec node: Permission denied error. Before when the agent would run terminal commands it was using the same terminal I have access to and it would open that terminal inside of the project folder. Now it seems to not be using the same terminal AND it doesn’t open it to the project folder.

It also says “Agent Terminal” instead of Cursor like it did before.

image

image

Hey, thanks for the report.

This is a known issue with the new Agent Terminal implementation in Cursor 2.x. The sandbox environment doesn’t load the user shell profile (.bashrc) or PATH.

Try this:

Step 1: Enable the Legacy Terminal Tool

  1. Open Cursor Settings Cmd/Ctrl+Shift+J
  2. Go to Agents → Inline Editing & Terminal
  3. Enable Legacy Terminal Tool
  4. Cmd/Ctrl+Shift+P → run Terminal: Kill All Terminals
  5. Fully restart Cursor

Step 2: If Legacy doesn’t help, set up a terminal profile

Add this to settings.json (Cmd/Ctrl+Shift+P → Preferences: Open User Settings (JSON)):

"terminal.integrated.profiles.linux": {
  "bash": {
    "path": "/bin/bash"
  }
},
"terminal.integrated.defaultProfile.linux": "bash"

(Replace linux with osx for macOS, or windows for Windows.)

A similar issue is discussed here: Cursor Terminal - Shell Profile

Let me know if this helps. If not, please share your Cursor version (Help → About) and your OS.

I have been using Legacy mode for a few months now. It has the same problem, as far as I can tell…it does not seem to load any kind of shell resource file. I have actually tried to set up custom integrated profiles. As far as I have been able to tell, those ONLY affect the interactive terminals you open (by default in the bottom middle of the Cursor/VSCode ui)… No custom profile I have ever set up, has ever had any impact to the AGENT terminal instances…

FWIW, my thread that you linked, is about AGENT terminal instances, not interactive terminal instances that me, the user, uses. My interactive terminals all properly use my .zshrc file.

I don’t know exactly when this shift happened…I think it was with 1.6.x, when you guys finally reworked the agent terminal system to resolve the problems that were plaguing it before 1.6. Since then, and it was I think some specific update during 1.6 refinement of the agent terminal redesign, when shell profiles were no longer used by the agent terminal instances. This was before the introduction of sandbox, but has persisted, WITH LEGACY TERMINAL MODE, since sandbox mode was introduced as well.

Its a real problem for me, as I have to burn quite a lot of tokens to keep the agent successfully running terminal commands, given the way it works now. There seem to be periodic and moderately frequent terminal recycles with the agent terminals now…it arbitrarily decides to create a new terminal instance, which can happen right in the middle of a chat (even work for a single prompt), requiring full re-setup of the environment for the work that was being done. This affects local psql usage, aws CLI usage, well, pretty much ANY custom CLI tools that I install and set up $PATH and other things for in my .zshrc file.

FWIW, I don’t necessarily want the agent terminal instances to use my full .zshrc file, either. I think what is really needed, is a way to configure the AGENT terminal instances independently of interactive terminal instances inside VSCode/Cursor. The config for settings.json that you shared, at least in my experience, ONLY affects interactive USER terminal instances, it does not affect sandbox or legacy mode AGENT terminals.

FWIW, the versions of Cursor that this has affected, thus far, is 1.6.X (middling version, don’t remember the exact start), 1.7.*, 1.8.*, 2.0.*, 2.1.*, 2.2.* and I am currently on 2.3.* and still have these issues.

1 Like

Try to reboot your PC. It may help for some time.

yes as stated, I do have the Legacy Terminal setting on but Cursor is ignoring that settings. This is what I have for terminal setting in my user json file.

“terminal.integrated.defaultProfile.windows”: “Git Bash”,

This issue is causing very strange behavior. The terminal the agent is trying to use keeps saying I am using php 8.2 when I don’t even have that installed on my system at all (it’s just 8.4)

ok what seems to be happening is that Cursor is trying to use WSL to execute terminal commands but it shouldn’t. I’m not sure how to verify this but that would explain why the terminal says I’m using a version of PHP that isn’t even installed on my machine (I use Laravel Herd for dev environments). Everything was working great until the last update. I really wish Cursor would stop introducing these massive breaking changes without even testing them first.

Alright, that makes more sense now. Cursor is switching into a WSL environment instead of your main Windows setup with Laravel Herd.

Try this:

Step 1: Start without extensions

  1. Fully close Cursor
  2. Open Command Prompt and run:
    cursor --disable-extensions
    
  3. Try starting Agent Terminal and check if it’s using the right environment

Step 2: Check WSL extensions

  • Open Extensions Ctrl+Shift+X
  • Search for extensions related to WSL or Remote
  • Temporarily disable any WSL or Remote extensions
  • Restart Cursor

Step 3: Make sure the project isn’t opened in WSL

  • In the bottom left of Cursor, you shouldn’t see an indicator like “WSL: Ubuntu” or similar
  • If you do, click it and select “Close Remote Connection”

Also, please share:

  • Your full Cursor version (Help > About > Copy)
  • Your list of installed extensions (especially WSL, Remote, Docker)

disabling all WSL extensions seems to have worked.

The terminal keeps using agents terminals despite the option “Legacy terminals” enabled

1 Like