NVM still having the same issue even with this approach.
It is powerlevel10k in my case as well.
just disable it in vscode and works fine for me.
if [[ "$TERM_PROGRAM" != "vscode" ]]; then
source /opt/homebrew/share/powerlevel10k/powerlevel10k.zsh-theme
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
fi
I completely removed p10k and am still having this issue
Ok so completely removing p10k and switching over entirely to bash from zsh seems to have resolved the issue.
I have a lot of such freezes when cursor does not understand that the command has finished executing in terminal and waits indefinitely for something - in different setups: in remote-ssh devcontainer bash (with empty .bashrc), in windows command line terminal, in windows git bash. About 30% of commands just hang. Is this a known issue that will be addressed?
■■■■, that’s unfortunate that even after going very vanilla in configuration, this issue is still happening. I haven’t tested it too much since going to Bash and removing Powerlevel10k, but this issue has been alive for a long time. And they’ve focused their efforts on features like Slack integration and some other stuff. I don’t know. But it would be great if they prioritize to this.
Worked for me. Thanks
100%
@Bhavikpatel576 @arthur-zhuk Could you confirm you are still having the issue despite the possible solutions in this thread?
if yes, in which cases? (always, only specific terminal commands?)
For most users this should be resolved as it is not the expected behavior and Cursor Team is looking into issue reports, but may need more information for finding a solution to your specific case. There are also some bufixes already done and upcoming in next version.
It would be good if you could just isolate the agent terminal environment so we don’t have to change our personal terminal environments. It happens pretty randomly. I’m sure there’s a pattern there, but I think it’s pretty common from what the people in the thread have been saying. If you’re using something like P10K and/or ZSH, that’s when the problem happens. A lot of the bug fixes in the thread did not work for me until I basically stripped out all the terminal configs I made to be completely vanilla. That sort of works, but I haven’t tested out all too much there.
The most annoying thing is that it solved itself it the last couple of weeks sometimes on it’s own, for me the agent would start showing this white simple terminal without my customization and it worked perfectly but it’s back and forth, I have no clue what triggers this as I never make any change to my setup
A quick solution, just for cursor is this.
Add a cursor rule: Always
- I use zsh, cursor has issues with zsh / p10k, lets use this template: bash -c "{command here}", this will insure we always receive output, but also receive our anticipated exit code.
If you use one of the newer AI agent models, it will take into consideration your ruleset, and it will always run the bash -c “{command}” instead of directly in zsh. This has resolved my issue.
You saved my day … was so upset with this… Cheers
Just to share what I did - I added your solution along with my zshrc file to o3 in ChatGPT. It gave me this command to get more data from my setup:
6. Debugging recipe (quickly diff the two shells)
- Open the IDE terminal and run
env > /tmp/env_ide
. - Ask Cursor Agent to run
env > /tmp/env_agent
. - Compare:
diff -u /tmp/env_ide /tmp/env_agent | less
.
Look for stable variables you can key on. npm_config_yes
, PAGER
, COMPOSER_NO_INTERACTION
, DISABLE_AUTO_UPDATE
, CI
, etc. usually appear only in the agent shell.
This way it found the exact precise variables to use for agent detection. It can be then reused in the future when Cursor or zsh updates.
Then I asked cursor to do everything and update the files and tested the commands both in IDE terminal and through agent calls.
Take care!
This works. Thank you
I’m on a windows machine, and still have this problem often, using both command prompt and powershell. The worst part is that sometimes a script will fail, but the agent, unable to see whatever the error was, just assumes that the script didn’t fail and continues on.
My government IT department doesn’t understand WSL, so containerization isn’t really a thing we get to do, so I need to be able to use windows out-of-thebox
Yeah, this is now totally broken for me after latest update to 1.2.2 (Linux). Every command the agent attempt starts a (bash) shell which does not exit - effectively hanging.
EDIT: unless fedora ships Powerlevel10k by default for bash I don’t use that. The prompt does include the active conda environment though.
EDIT: The “I use zsh, cursor has issues with zsh / p10k, lets use this template: bash -c “{command here}”, this will insure we always receive output, but also receive our anticipated exit code” trick does not work. The agent follows the instructions but sill end up in a running shell…
EDIT: it’s is not a good combination to ship such bugs and having the only real debug mechanism be to use the limited prompts on debugging. I assume such prompts as “run printenv” will spend a prompt?
EDIT: at least provide better docs for how the shell is being used. this is very sparse. By “first profile”, you mean the what? terminal.integrated.profiles
?
When powershell hangs, I just told agent chat to use Terminal instead of powershell and it worked!
I was looking through the list of Terminal-related settings and noticed that this one was disabled and marked as non-default (probably got imported from VS Code):
terminal.integrated.shellIntegration.enabled
After I re-enabled it, terminal calls stopped getting stuck. I tried disabling it again and verified that this was the problem.
hi @laughedelic thank you for the tip, which OS and Cursor version are you using?