with a recent update, Cursor agent now defaults to bash terminal ( I use ZSH) as well does not share normal terminal scopes when running it’s terminal commands. Besides the fact that the terminal is read only, whatever this change was it is causing ALL kinds of trouble for me. Best example is up until last update, the Cursor agent would be able to use: kubectl commands without any issue. once i authenticate in any terminal window with AWS the Cursor terminal would be able to run kubectl commands without any issue, now it says “user is not authenticated” this is adding literally hours upon my develop time
Steps to Reproduce
set default terminal to Zsh then instruct Cursor agent to run any type of termional commands and note it defaults to using bash. Then use aws configure sso and run kubectl commands in any terminal (MacOS) without any issues then instruct Cursor Agent to run kubectl commands and note the authentication issue.
Expected Behavior
Cursor agent should use default terminal (zsh) set in Cursor settings and should be able to run any kubectl commands without auth errors.
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
I’ve noticed a recent change in how the Cursor Agent executes terminal commands. It seems that the Agent no longer uses an interactive shell, which means it doesn’t load my .zshrc file.
Even when I explicitly configure VS Code to use an interactive shell, the Agent seems to ignore it. Here’s what I have in my settings.json:
I am also suffering from this problem in the newest Cursor (Version: 1.6.45). None of the settings I change for terminal profile can force it to stop using /opt/homebew/bin/bash (my MacOS user’s default shell).
I wouldn’t have a problem with this, but something that’s unique to Cursor’s invocation of bash causes my cd command to completely break, making it impossible for the Agent to change directories. This has something to do with Autoenv, because I get this error message when the AI tries to cd, unless I take the setup for Autoenv out of my .bash_profile file:
--: line 76: __autoenv_has_builtin: unbound variable
Autoenv works just fine in my actual terminal, and even in the Cursor integrated terminal. It only breaks for the AI agent.
I asked the agent what terminal it uses, and it mentioned “I use the run_terminal_cmd tool which runs commands in your system’s shell.” So I’m guessing that maybe `run_terminal_cmd` got broken in a recent version?
This unfortunately did not work for me. I still get the same problem of the cd command being completely broken, as if my autoenv setup is corrupt somehow.
Hey folks, we’ve made some changes to how the agent terminal works in recent releases. As you’ve noticed, the agent terminal is no longer interactive, however it does source all shell profiles that an interactive terminal typically would. We’ve found that disabling interactivity significantly improves the stability of the terminal tool and results in fewer situations where Agent is blocked. We always use the shell specified by the SHELL environment variable on your system, and the terminal.integrated.* settings only impact the cursor integrated terminal (ctrl+`), not the agent terminal.
@coredumperror the issue you’re encountering with unbound variables was fixed in yesterday’s release (1.7.40). Please let me know if you’re still encountering the issue.
Thanks for the update! I don’t see that error any more when the agent tries to use cd… but now I see a new error that makes cd equally broken. >_<
I told the Agent to cd into a folder and run ls, just for a simple test. Here’s what I got:
$ cd /Users/coredumperror/dev/palomar_rms/palomar_rms/registration && ls
--: line 74: chdir: command not found
No idea what file it’s even complaining about, now. The error doesn’t appear to depend on there being a .autoenv file in the folder it’s cd’ing into, as it will fail with the same error even if I remove my .autoenv file.