Why Cursor Lags (and how to fix)

Describe the Bug

As many other posts have noted Cursor can be extremely laggy when the chat window is open (often 50-100ms frames).

I think this is mostly due to how Cursor renders terminal tool call output (although the chat window seems laggier than it needs to be in general so I could see this being a broader issue on different hardware).

Steps to Reproduce

In my experience the lag becomes noticeable in chats with terminal tool calls, even if the chat has a small number of turns. Empty chats do not cause lag, and closing the chat pane immediately stops the lag.

From profiling, this seems to be due to long “Hit test” tasks. The length of these hit tests also seem to scale with the number of DOM nodes in the chat.

When the chat is closed, hit test tasks take ~1ms, and each frame completes in 5ms or so with plenty of breathing room. This might only grow to 2-3ms for long chats without much content to render, while chats with one or two messages including terminal output might have a 10-30ms hit tests. I’ve seen longer chats with multiple terminal tool calls have 100-300 of ms of hit tests.

To confirm terminal output is the main issue, adding this CSS makes chats with terminal tool calls perform like normal chats:

.composer-terminal-static-render {
  display: none;
}

For anyone else with this issue, adding this CSS in dev tools limits the terminal output to 16 lines, but prevents most of the lag in my experience:

.composer-terminal-static-render .view-lines > :not(:nth-last-child(-n+16)){
  display: none;
}
.composer-terminal-static-render .simple-code-render {
  position: absolute !important;
  bottom: 0;
}

Expected Behavior

Looking at how terminal output is rendered, Cursor seems to be wrapping it in a monaco editor which results in tons of DOM nodes, especially since monaco doens’t use any virtualization as far as I can tell.

The normal canvas-based xterm terminals in Cursor don’t lag, so a canvas-based solution or at least some sort of virtualization is probably needed to prevent lag.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.1.2
VSCode Version: 1.96.2
Commit: 87ea1604be1f602f173c5fb67582e647fcef6c40
Date: 2025-06-13T00:30:10.108Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.4.0

Additional Information

Other posts with similar experiences for more context:

https://forum.cursor.com/search?q=lag%20%23bug-report%20order%3Alatest

Closed chat:


Open chat:

Long chat:

Does this stop you from using Cursor

No - Cursor works, but with this issue

2 Likes

Hey, thanks for the report. We’ll investigate it.

2 Likes

Is this just for the ‘archived’ terminals that have finished, and not the live ones?

1 Like

I am begging you to fix this, because that makes me angry haha