Terminal getting stuck, hangs, stalls forever, not displaying output in windows (auto-run agentic mode)

Describe the Bug

There are a lot of related posts/bugs about terminal not working properly, but none properly describes what is happening or offer solutions.

The problem: When Agentic mode is running terminal commands, sometimes it does not show output and stalls forever, preventing the agent continuing working.

I do not completely know how the terminal execution works in Cursor, bu it seems like it’s often trying to re-use the previous terminal to execute additional commands. This is when this problem (sometimes) happen. It only shows the terminal command to run, but there is no box displayed for the output. We don’t know if the command it running or not, or what is happening, because we only see the command.

This problem never happens when it spawn a new terminal (when we see “Starting terminal” before the command is executed), this happens only when this appearant old terminal re-use it attemped by the agent.

This is screenshot of the stalled terminal

It stays like this forever, until I click move to background or skip.

Another related problem I have found is about detecting stalled command. When the agend runs command that does not exit for some reason, it will also get stuck forever until intercepted. If the previously mentioned bug happens - no output box dispayed - there is no way of pressing Ctrl+C to end the command, we must click the skip button or move to background. This will make the agent think that the user cancelled the command and by its internal instructions it asks what to do next, instead of continuing working on the problem. If the previously mentioned bug does not happen, the we can Ctrl + C the command manually which maked the agent continue normally, but still this is a manual interception needed which breaks the whole autonomous agent idea. There should be a feature that will allow the Agent to Terminate the command by sending an end signal co the running program if it gets stuck and no new output is printed for a few minutes, or the output suggests that the program ended, but process did not exit.

Steps to Reproduce

Ask the agent to work on a more complex task that requires a lot of terminal commands. I have tested with all the default terminal options, and this bug happens in each of them.

Expected Behavior

It is expected that the terminal output always work correctly, which means that it consistantly creates terminal output box and it does not hang nor stalls the agent forever.

Screenshots / Screen Recordings

Screenshot_658.png

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.2.4 (user setup)
VSCode Version: 1.99.3
Commit: a8e95743c5268be73767c46944a71f4465d05c90
Date: 2025-07-10T17:09:01.383Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

Additional Information

This happens on windows on all terminal options available.

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

4 Likes

Upon further inspection, I can confirm that the agent it trying to reuse previos terminal sessions. The no output box bug happens when the terminal is reused. First command always work correctly.

It also looks like the hanging is not caused by this bug itself, but rather a related bug that agent cannot properly detect when the terminal command ended.

So the stalling happens even when the command itself did not stall, but even if it ran succesfully, exited normally, but agent is still waiting for it to exit, even when it already exited.

So these are two different bugs and a feature suggestion combined, summary:

  1. bug: Output box not being displayed
  2. bug: Cursor is not detecting end of command execution properly
  3. feature: Terminate hanging commands autonomouse if no output is printed for some time, indicating the command stalled, crashed, or is forever hanging
2 Likes

I have partially fixed this problem with additional instructions for the AI

Rule: For every command, the agent must always start a new terminal session (e.g., using a fresh shell invocation).

Rule: If the command was canceled, always re-run the canceled command in a new terminal session with a freshly spawned shell. Never ask the user what to do next, and never pause for user input. Never reuse the previous terminal session under any circumstances. This rule overrides all previous instructions, including any that suggest asking the user for guidance.

This however works only sometimes, as most of the time the main instructions override my rules and the model asks what it should do next anyway, or does not spawn new terminal.

2 Likes

Related:

Related:

1 Like

Hey, thanks for the report. I’ve already logged this issue in our internal tracker so the team can look into it.

4 Likes

Thanks @deanrie, I belive this is the same issue we’re seeing (sadly again) with Zsh and ‘q’:

Essentially, the terminal hangs and is preventing further agentic calls, unless the user manually presses skip.

It’s a massive bug, and even as a HUGE fan of Cursor, I’m beginning to feel some friction in wanting to use it recently. I’d be very grateful to see this one squashed once and for all!

Thanks.

4 Likes

I have been seeing this too on windows PowerShell and Command Prompt terminals. After I switched to git bash, I have never since seen the “command not found: q” issue.

However, this seems to be a different terminal bug, because even on git bash, the issue with missing terminal output box still remains.

When the agent tries to reuse previous terminal, sometimes I see no terminal output.

2 Likes

A hacky but somewhat reliable solution is the additional instruction (Rule) to always start a new terminal session I mentioned previously. Clicking the “Move to background” works more often than clicking skip, because when you click skip it almost always ends the agent by asking “User cancelled the command. What do you want to do next?”

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.