Agents hang when window is not in focus

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

My workflow recently has been to have several persistent worktrees, each with a separate cursor window that I swap back and forth on my mac. This ends up being 5+ cursor windows, each with an agent running.

However, even if my macbook is active and I am working on it, the agents seem to freeze until I focus back on that window. Once I am looking at the specific window, the agent starts back up again without me doing anything.

This makes it very difficult to parallelize things, since agents aren’t actually working to completion and I have to cycle through them just to keep them going.

This is persistent. I am ssh’d into an ubuntu machine.

I have tried:

  1. mac caffeinate
  2. Cursor is not using appnap

The commands are not trying to access the internet, it is just using linux commands to run python and c++ tests. Its not the commands themselves that are hanging, its something to do with cursor, since if I am focused on the window the whole time, it finishes without hanging.

Steps to Reproduce

Open up 5+ cursor windows on mac in different worktrees
Run agents on each of them, they should be accomplishing a coding task that requires running tool calls and linux pythong commands
Unfocus them and do something else on the machine like surfing the internet.
See that they don’t actually finish the task until you focus back on their window.

Expected Behavior

They should keep running.

Operating System

MacOS

Version Information

Version: 2.6.20 (Universal)
VSCode Version: 1.105.1
Commit: b29eb4ee5f9f6d1cb2afbc09070198d3ea6ad760
Date: 2026-03-17T01:50:02.404Z (4 days ago)
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.3.0

For AI issues: which model did you use?

All models, mostly composer 2.0 fast and gpt 5.4

For AI issues: add Request ID with privacy disabled

ff05db66-d2e4-49f9-a691-87ef89e65938

Additional Information

several others in my org have reported this and it has encouraged them to switch to claude code. :confused:

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

1 Like

Hi Zachary!

This is a known bug on our side. When Cursor windows lose focus on macOS, the system throttles background processes (Chromium background throttling and macOS App Nap), which prevents the terminal output polling from working correctly. The agent’s commands still execute successfully on the remote machine, but Cursor can’t capture the output in time, so the agent gets stuck in a loop trying to figure out why its shell tool isn’t returning anything.

We’ve fixed this same class of issue in other parts of the UI before, but the terminal output path hasn’t been addressed yet. The team is aware and it’s being tracked.

As a temporary workaround, the main option right now is to keep agent windows on the same macOS desktop tiled side by side, rather than spreading them across separate desktops/spaces. This prevents macOS from fully throttling the background windows. It’s not ideal for your 5+ window workflow, but it should keep the agents running.

You may also find this related thread helpful: Cursor agent shell loses output when window loses focus (macOS)

Let me know if you have any questions.

Thank you. I figured it was some kind of os throttling. However, looking at the system monitor, it doesn’t seem like App Nap is on when this is happening. I’ve also experienced this on ubuntu, but to a lesser extent and it was a few months ago.

This is unfortunately blocking for my workflow. Can you provide an estimated timeline for this fix? I need to understand whether I should learn a new workflow via cli or other product in the meantime or whether it is quick enough for me to just wait.

Alternatively, cursor glass may be a more complete solution to my problem by reducing the window count, but it seems unavailable for enterprise. I really just want one window that I can see:

  1. All my worktrees and agents and their status on the sidebar.
  2. Ability to pop open a vscode-style view for any of those worktrees as needed.

The appnap would still be an issue but since I’d have only one window for all my projects it would be less of a concern.

@mohitjain Any update? This is preventing me from using cursor effectively, since the app almost always goes to sleep if I’m focusing on something else. Note that I’ve reduced my number of windows and I’m still seeing this issue consistently.

Zachary, sorry for the delay here.

Good news on Glass — it’s now available for Enterprise. You can get started at cursor.com/glass. This should help significantly with your workflow since it’s designed as a single-window experience for managing multiple agents, which would reduce the background window throttling issue you’re hitting.

On the core throttling fix — I don’t have a timeline to share. I’ve escalated the priority on this given the impact on your workflow.

1 Like