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.

1 Like

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.