Cursor Go Debugger: 'Restart' hangs server while 'Stop' works

Describe the Bug

For some time now, the ‘Restart’ debug command in Cursor hasn’t been working correctly after I launch my Go server.

When I run my Go server (I’ve tested this with both Fiber and WebSocket servers), the ‘Stop’ button terminates the process as expected. However, when I press the ‘Restart’ button, the process hangs instead of terminating, and it continues to occupy the port. If I then send a kill signal to the hung process from an external terminal, the restart operation proceeds.

A strange thing is that if I press the ‘Restart’ button multiple times while it’s hung, a corresponding number of “exiting…” messages appear all at once after the process is finally killed.

I suspect that when I press the ‘Restart’ button, the signal isn’t being delivered to the process correctly, perhaps due to a lock. When an external kill signal releases this lock, all the queued restart signals seem to be delivered at once.

I’m not sure if this is a problem with Go’s Delve debugger (dlv) or with Cursor itself. I’ve reproduced the same issue on a secondary computer with a fresh install of Cursor and a simple test case.

Steps to Reproduce

  1. start golang process
  2. press restart button

Expected Behavior

process don’t be terminated

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.2.4 (Universal)
VSCode Version: 1.99.3
Commit: a8e95743c5268be73767c46944a71f4465d05c90
Date: 2025-07-10T16:55:16.443Z
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.5.0

1 Like

I’ve found the cause. The issue was with Delve (dlv) version 1.25.1.

Apparently, v1.25.1 included some improvements related to the restart functionality. However, it seems a change was also made to disable restarts in noDebug mode (“Run Without Debugging”). I’m a bit puzzled as to why this would affect normal debug mode, but that appears to be the case.

For now, I’ve downgraded to dlv v1.25.0 and can confirm that everything is working correctly again.

2 Likes

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