Cursor hangs executing a snippet "agent is waiting for a command"

I’ve been having a repeat issue where cursor is executing some (often) simple python snippet and hangs indefinitely at “Agent is waiting for a command to finish”, with the option to run it in the background. It generally never finishes, but copying the command and pasting it on the terminal, executes and completes in sub-second times. It’s really limiting the ability to use cursor effectively. What is the best way to move forward with this and are there any workarounds?

Hey, this is a known class of bugs with command completion detection in the agent terminal. The command actually runs, but Cursor doesn’t get the completion signal via shell integration or the fd 3 bootstrap handshake, so the agent gets stuck on waiting for a command to finish. The issue is being tracked, but there’s no ETA for a fix yet.

A workaround that usually helps right now:

  • Cursor Settings > Agents > enable Legacy Terminal

This mode uses an older completion detection method and avoids the broken path.

To better match your case to the bug, please share:

  • Your OS and Cursor version via Help > About or Cursor > About Cursor
  • Which shell you use zsh, bash, fish, or pwsh, and whether you use oh-my-zsh, powerlevel10k, starship, etc. Some prompt themes strip OSC sequences that are needed for detection.

Related threads for context:

Let me know if Legacy Terminal helps.

Thank you.

FWIW, the mode appears to be named “Legacy Terminal Tool” instead of “Enable Legacy Terminal” - mentioning here since the former didn’t resolve to anything when searching in the settings.

I’m on Mac OSX 15.7.2 (24G325) (Sequoia)

Version: 3.2.11
VSCode Version: 1.105.1
Commit: e9ee1339915a927dfb2df4a836dd9c8337e17cc0
Date: 2026-04-24T14:36:47.933Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 24.6.0

I use “bash” and I don’t use any of those tools

@deanrie it did not appear to have helped, sadly.

Hey, thanks for the update and for correcting the setting name Legacy Terminal Tool, you’re right.

If Legacy Terminal Tool didn’t help, that’s an interesting signal, since it usually bypasses the part where detection fails. A few things that can help narrow it down:

  1. An example command where this happens. If you can, share a specific Python snippet and how exactly the agent runs it. Also, do you see the command output in the terminal, or is the panel empty and only the spinner shows.
  2. Terminal logs: go to View > Output, then in the dropdown on the right pick the Terminal channel, and also Shell Integration if it’s there. Share what it shows for the last 1 to 2 stuck runs.
  3. Double check that after switching Legacy Terminal Tool you fully restarted Cursor with Cmd+Q, not just Reload Window. Otherwise the old terminal session might stay on the new code path.
  4. If you’re using a Python venv, try running the agent in a project where the venv doesn’t auto activate, or temporarily remove activation from ~/.bashrc or ~/.bash_profile. Sometimes the activation hook prints something unusual and breaks completion detection.

Also, as a quick sanity check, open the normal terminal inside Cursor with Ctrl+\, run echo $TERM_PROGRAM and echo $VSCODE_SHELL_INTEGRATION, and share the output. That helps confirm whether shell integration is active.

The issue is being tracked, but there’s no ETA yet. Let me know what the logs show and we can try to pin it to a specific code path.

So, on the same day I applied these settings (and subsequently restarted cursor) - I still experienced it a couple of times. Today, after a few days off, I haven’t experienced it again. I will keep an eye on it and if it repeats, I’ll update this post.

Is there a way to track progress on this issue, so I can reset the toggle back to the default at some point?